CLI tool that tells you when dependencies are missing from package.json and offers you a choice to install them. Also tells you when dependencies are listed in package.json but are not being used anywhere in your project. Node.js command line tool and API.
Install globally with npm:
npm i -g lint-deps
var deps = require('lint-deps');
// pass the directory to scan
console.log(deps('lib'));
In the command line:
deps
-r
|--report
: save a report to disk. By defaultreport.json
is saved. To change the path do:-r foo.json
-e
|--exclude
: comma-separated list of files or directories to exclude. Example:deps -e test,lib
If everything is good, you'll see something like this:
If packages are missing, you'll see a prompt like this (also shows which files require the package):
If you choose yes:
choose dependencies
Workds the same way for devDependencies
:
choose "nothing, just install"
Now hit enter and everything that was checked will be installed.
If you choose no:
Done.
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on November 29, 2014.