Skip to content

Command-line tool to check for dependencies that are not listed in package.json, and optionally add them. Also tells you when packages that aren't used anywhere are listed in package.json.

doowb/lint-deps

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lint-deps NPM version

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

Install globally with npm:

npm i -g lint-deps

API

var deps = require('lint-deps');

// pass the directory to scan
console.log(deps('lib'));

CLI

In the command line:

deps

Commands

  • -r | --report: save a report to disk. By default report.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

Examples

If everything is good, you'll see something like this:

image

Install missing packages

If packages are missing, you'll see a prompt like this (also shows which files require the package):

image

If you choose yes:

image

choose dependencies

Workds the same way for devDependencies:

image

choose "nothing, just install"

image

Now hit enter and everything that was checked will be installed.

If you choose no:

image

Done.

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert
Released under the MIT license


This file was generated by verb on November 29, 2014.

About

Command-line tool to check for dependencies that are not listed in package.json, and optionally add them. Also tells you when packages that aren't used anywhere are listed in package.json.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  
  •  

Packages

No packages published

Languages

  • JavaScript 100.0%