Giter Club home page Giter Club logo

npm-courier's Introduction

npm-courier

npm version npm

Delivers your local packages right to your projects without the need to use npm link.

The Problem

If you've ever developed an npm package. You know how annoying it is to test it locally with npm link. This problem gets even worse when you know that npm link behaves differently depending on your npm version; even when npm link works as expected, you'd need to link the package every time you made a change.

The Solution

npm-courier picks up your local package, and drops it into your project. You can also use it to automatically update your project whenever you make changes to the source code of your package. You can think of npm-courier as an alternative to npm link that does not use symlinks and has optional automatic reloading.

Installation

  1. npm install -g npm-courier
  2. Profit!

Usage

npm-courier acts like a courier (duh!). It picks up a package, and drops it off to recipients. In this case your recipients would be your projects that need to use the local module.

  1. Go to your local npm module.
  2. Run courier pickup.
  3. Go to your project root.
  4. Run courier drop <package name>

Additionally, if you want to run npm-courier so that it watches for changes in the package and automatically applies them to your project follow these additional steps:

  1. Go to your local npm module.
  2. Run courier watch

Now whenever any changes are detected, the package will be updated in all places where it has been dropped before.

Removing project as a drop location

If you drop a package in multiple locations, then using courier watch would update all the locations in which the package was dropped. In order to prevent this, run courier reset <package-name> in the root directory of your project when done. This will remove that project from the drop locations of the package. This will also change the project's package back to the published version that existed before.

Removing all drop locations

Basically if you want to start from scratch, use the appropriately named nuke command

courier nuke

Using package.json

In the case you're always testing the same package(s) in a project and don't want to manually type the package names in the terminal every time. You can add a courier key to your project's package.json and give it a value of an array with all the package names you'd like to drop. Note that you would still need to pickup the packages manually the first time. All commands that accept a package name would also work with this method.

Example:

  1. Go to packageA
  2. courier pickup
  3. Go to packageB
  4. courier pickup
  5. Add this to your project's package.json
"courier": ["packageA", "packageB"]
  1. In your project, run courier drop
  2. When done, run courier reset

npm-courier's People

Contributors

sayegh7 avatar

Watchers

 avatar  avatar

npm-courier's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.