npm-check

Check for outdated, incorrect, and unused dependencies.

npm-check

Check for outdated, incorrect, and unused dependencies.

This is how you should use npm-check.

$ npm install -g npm-check
$ npm-check

The result should look like the screenshot, or something nice when your packages are all up-to-date and in use.

$ npm-check --help
 
  Usage: npm-check [options]
 
  Options:
 
    -h, --help         output usage information
    -V, --version      output the version number
    -u, --update       Interactive update.
    -g, --global       Look at global modules.
    -s, --skip-unused  Skip check for unused packages.
    -p, --production   Ignore devDependencies.

Show an interactive UI for choosing which modules to update.

Automatically updates versions referenced in the package.json.

Based on recommendations from the npm team, npm-check only updates using npm install, not npm update. To avoid using more than one version of npm in one directory, npm-check will automatically install updated modules using the version of npm installed globally.

Check the versions of your globally installed packages.

Tip: Use npm-check -u -g to do a safe interactive update of global modules, including npm itself.

By default npm-check will let you know if any of your modules are not being used by looking at require statements in your code.

This option will skip that check.

This is enabled by default when using global or update.

By default npm-check will look at packages listed as dependencies and devDependencies.

This option will let it ignore outdated and unused checks for packages listed as devDependencies.

The API is here in case you want to wrap this with your CI toolset.

var npmCheck = require('npm-check');
 
npmCheck(options)
  .then(result);
  • default is false

Use the globally installed packages. When true, the path is automatically set.

  • default is false

Interactive update.

  • default is false

Skip checking for unused packages.

  • default is false

Ignore devDependencies.

  • default is cwd

Override where npm-check checks.

#####result

object of module names : data

data looks like this:

About the module

  • moduleName: name of the module.
  • homepage: url to the home page.

Versions

  • latest: latest according to the registry.
  • installed: version in node_modules.
  • packageJson: version or range in package.json.
  • devDependency: Is this a devDependency?
  • usedInScripts: Is this used in the scripts section of package.json?
  • mismatch: Is the version installed not match the range in package.json?
  • semver_validRange: Is the package.json range valid?
  • semver_valid: Is the installed version valid semver?
  • easy_upgrade: Will using npm install upgrade the module?
  • bump: What kind of bump is required to get the latest, such as patch, minor, major.
  • unused: Is this module used in the code?
  • npm outdated - awkward output, requires --depth=0 to be grokable.
  • david - does not work with private registries.
  • update-notifier - for single modules, not everything in package.json.
  • depcheck - only part of the puzzle. npm-check uses depcheck.

Hi! Thanks for checking out this project! My name is Dylan Greene. When not overwhelmed with my two young kids I enjoy contributing to the open source community. I'm also a tech lead at Opower.

Here's some of my other Node projects:

NameDescriptionnpm Downloads
grunt‑notifyAutomatic desktop notifications for Grunt errors and warnings using Growl for OS X or Windows, Mountain Lion and Mavericks Notification Center, and Notify-Send.
shortidAmazingly short non-sequential url-friendly unique id generator.
grunt‑promptInteractive prompt for your Grunt config using console checkboxes, text input with filtering, password fields.
rssRSS feed generator. Add RSS feeds to any project. Supports enclosures and GeoRSS.
xmlFast and simple xml generator. Supports attributes, CDATA, etc. Includes tests and examples.
changelogCommand line tool (and Node module) that generates a changelog in color output, markdown, or json for modules in npmjs.org's registry as well as any public github.com repo.
grunt‑attentionDisplay attention-grabbing messages in the terminal
observatoryBeautiful UI for showing tasks running on the command line.
anthologyModule information and stats for any @npmjs user
grunt‑catEcho a file to the terminal. Works with text, figlets, ascii art, and full-color ansi.

This list was generated using anthology.

Copyright (c) 2015 Dylan Greene, contributors.

Released under the MIT license.

Screenshots are CC BY-SA (Attribution-ShareAlike).


Generated using grunt-readme with grunt-templates-dylang on Monday, February 23, 2015. _To make changes to this document look in /templates/readme/