get-wanted-dependencies
Get a list of NPM package dependencies that are "wanted", based on the contents of package.json
and what is currently installed in /node_modules
.
Installation
Install the package with NPM:
$ npm install -g get-wanted-dependencies
The -g
flag is recommended for easy CLI usage, but completely optional.
API
The package exposes a function with the signature (dir, callback)
, where dir
is the directory containing package.json
and callback
is a typical Node.js-style callback function.
Example:
; ;
CLI
Run get-wanted-dependencies
from the command line to output a list of wanted dependencies for the current directory:
$ get-wanted-dependencies
Tip
When working on a team, one can sometimes forget to run npm install
after pulling in dependency changes made by others. Solution – integrate the package into your automated build system!
Example gulp task:
gulp;