2017-12-03 11:15:02 +00:00
# updates
[![ ](https://img.shields.io/npm/v/updates.svg?style=flat )](https://www.npmjs.org/package/updates) [![ ](https://img.shields.io/npm/dm/updates.svg )](https://www.npmjs.org/package/updates) [![ ](https://api.travis-ci.org/silverwind/updates.svg?style=flat )](https://travis-ci.org/silverwind/updates)
2019-03-07 20:23:03 +00:00
> flexible npm dependency update tool
`updates` is a CLI tool which checks for npm dependency updates of the current project and optionally updates `package.json` . It is highly configurable and is typically able to complete in less than a second.
2017-12-03 11:15:02 +00:00
2017-12-03 13:27:35 +00:00
< p align = "center" >
2018-12-02 10:56:13 +00:00
< img src = "https://i.imgur.com/tI7rp0g.png" / >
2017-12-03 13:27:35 +00:00
< / p >
2017-12-03 13:14:30 +00:00
2019-03-07 20:23:03 +00:00
## Usage
2017-12-03 11:30:39 +00:00
2017-12-03 12:18:53 +00:00
```console
2018-01-16 20:59:59 +00:00
$ npm i -g updates
2017-12-03 11:30:39 +00:00
```
2019-03-07 20:23:03 +00:00
Then, check for new updates:
```console
$ updates
```
When changes are satisfactory, update `package.json` and re-install modules:
```console
$ updates -u & & rm -rf node_modules & & yarn
```
## Options
See `--help` or below for the available options. Option that take multiple arguments can take them either via comma-separated value or by specifying the option multiple times. If an option has a optional `pkg` argument but non is given, the action will be applied to all packages instead.
2018-09-02 08:35:47 +00:00
```
usage: updates [options]
Options:
2018-10-16 15:24:05 +00:00
-u, --update Update versions and write package.json
2018-09-02 19:43:16 +00:00
-p, --prerelease [< pkg , . . . > ] Consider prerelease versions
2019-02-25 21:46:39 +00:00
-R, --release [< pkg , . . . > ] Only use release versions, may downgrade
2018-09-02 19:43:16 +00:00
-g, --greatest [< pkg , . . . > ] Prefer greatest over latest version
2018-10-16 15:24:05 +00:00
-i, --include < pkg , . . . > Include only given packages
2018-09-02 19:43:16 +00:00
-e, --exclude < pkg , . . . > Exclude given packages
2018-10-16 15:24:05 +00:00
-t, --types < type , . . . > Check only given dependency types
2018-12-21 22:17:39 +00:00
-P, --patch [< pkg , . . . > ] Consider only up to semver-patch
-m, --minor [< pkg , . . . > ] Consider only up to semver-minor
2018-10-15 06:05:54 +00:00
-E, --error-on-outdated Exit with error code 2 on outdated packages
2018-10-16 15:24:05 +00:00
-r, --registry < url > Use given registry URL
2018-11-27 22:42:10 +00:00
-f, --file < path > Use given package.json file or module directory
2018-09-02 19:44:11 +00:00
-j, --json Output a JSON object
2018-09-02 19:43:16 +00:00
-c, --color Force-enable color output
-n, --no-color Disable color output
-v, --version Print the version
-h, --help Print this help
2018-09-02 08:35:47 +00:00
Examples:
$ updates
$ updates -u
2019-02-06 06:35:03 +00:00
$ updates -u -m
2018-11-19 14:53:48 +00:00
$ updates -u -e chalk
2018-10-16 15:18:06 +00:00
$ updates -u -t devDependencies
2018-09-02 08:36:52 +00:00
```
2018-09-02 08:35:47 +00:00
2019-03-07 20:23:03 +00:00
## JSON Output
2017-12-08 13:39:52 +00:00
2018-12-02 08:20:31 +00:00
The JSON output is an object with possible properties `results` , `message` and `error` :
2017-12-08 13:39:52 +00:00
2017-12-03 16:05:35 +00:00
```console
2018-10-25 20:36:41 +00:00
$ updates -j | jq
2017-12-08 13:39:52 +00:00
{
"results": {
2018-12-21 22:17:39 +00:00
"string-width": {
"old": "2.1.1",
"new": "3.0.0",
"info": "https://github.com/sindresorhus/string-width"
2017-12-08 13:39:52 +00:00
},
2018-12-21 22:17:39 +00:00
"eslint": {
"old": "5.9.0",
"new": "5.10.0",
"info": "https://github.com/eslint/eslint"
2017-12-08 13:39:52 +00:00
},
2018-12-21 22:17:39 +00:00
"eslint-config-silverwind": {
"old": "2.0.11",
"new": "2.0.12",
"info": "https://github.com/silverwind/eslint-config-silverwind"
2017-12-08 13:39:52 +00:00
}
2017-12-03 16:05:35 +00:00
}
2017-12-08 13:39:52 +00:00
}
2017-12-03 16:05:35 +00:00
```
2017-12-03 11:15:02 +00:00
© [silverwind ](https://github.com/silverwind ), distributed under BSD licence