Npm Tips06 Apr 2014
Here are some quick tips to help you be more productive with npm.
Use this to see any module dependencies that are out of date. This can get kind of ugly though so specify the depth to see only your outdated dependencies.
$ npm outdated --depth 0
The link command creates a symbolic link to a module on your machine. Use this to easily consume modules that you are working on. You can also link a global module to your path when working on a command line module.
To use a local module, change to the directory of your project and run
$ npm link /path/to/module
You will then have access to that module from your project.
Use npm version to update the version of your module. This will update the package.json version for the module and commit the change.
$ npm version 0.1.1
Use this ignore file to prevent your test sources from being published along
with your module. This works the same way as
# do not publish unnecessary files: .travis.yml .jshintrc Makefile spec coverage
npm has some helpful shortcuts to make your life easier, here are some common ones.
$ npm i <module> # short for npm install $ npm i <module> -S # short for npm install --save $ npm i <module> -D # short for npm install --save-dev $ npm i <module> -g # short for npm install --global $ npm r <module> # short for npm uninstall