dylang / npm-check
- пятница, 1 апреля 2016 г. в 03:14:42
JavaScript
Check for outdated, incorrect, and unused dependencies.
Check for outdated, incorrect, and unused dependencies.
-g
.-u
.import from
syntax.npm@3
, so dependencies go where you expect them.private: true
in their package.json.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.
Usage
$ npm-check <path> <options>
Path
Where to check. Defaults to current directory. Use -g for checking global modules.
Options
-u, --update Interactive update.
-g, --global Look at global modules.
-s, --skip-unused Skip check for unused packages.
-p, --production Skip devDependencies.
-E, --save-exact Save exact version (x.y.z) instead of caret (^x.y.z) in package.json.
--no-color Force or disable color output.
--no-emoji Remove emoji support. No emoji in default in CI environments.
--debug Debug output. Throw in a gist when creating issues on github.
Examples
$ npm-check # See what can be updated, what isn't being used.
$ npm-check ../foo # Check another path.
$ npm-check -g -u # Update globally installed modules by picking which ones to upgrade.
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
.
Install packages using --save-exact
, meaning exact versions will be saved in package.json.
Applies to both dependencies
and devDependencies
.
Enable or disable color support.
By default npm-check
uses colors if they are available.
Enable or disable emoji support. Useful for terminals that don't support them.
The API is here in case you want to wrap this with your CI toolset.
var npmCheck = require('npm-check');
npmCheck(options)
.then(result);
npmCheck(options)
returns promise
boolean
false
Use the globally installed packages. When true
, the path
is automatically set.
boolean
false
Interactive update.
boolean
false
Skip checking for unused packages.
boolean
false
Ignore devDependencies
.
string
cwd
Override where npm-check
checks.
boolean
false
Save exact versions to package.json
result
object of module names : data
data
looks like this:
About the module
Versions
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:
Name | Description | npm Downloads |
---|---|---|
grunt‑notify |
Automatic desktop notifications for Grunt errors and warnings. Supports OS X, Windows, Linux. | |
shortid |
Amazingly short non-sequential url-friendly unique id generator. | |
space‑hogs |
Discover surprisingly large directories from the command line | |
rss |
RSS feed generator. Add RSS feeds to any project. Supports enclosures and GeoRSS. | |
grunt‑prompt |
Interactive prompt for your Grunt config using console checkboxes, text input with filtering, password fields. | |
xml |
Fast and simple xml generator. Supports attributes, CDATA, etc. Includes tests and examples. | |
changelog |
Command 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‑attention |
Display attention-grabbing messages in the terminal | |
observatory |
Beautiful UI for showing tasks running on the command line. | |
anthology |
Module information and stats for any @npmjs user | |
grunt‑cat |
Echo a file to the terminal. Works with text, figlets, ascii art, and full-color ansi. |
This list was generated using anthology.
Copyright (c) 2016 Dylan Greene, contributors.
Released under the MIT license.
Screenshots are CC BY-SA (Attribution-ShareAlike).
Generated using grunt-readme with grunt-templates-dylang on Tuesday, March 29, 2016.
_To make changes to this document look in /templates/readme/