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)
2017-12-03 11:36:27 +00:00
> Fast npm dependency updating tool
2017-12-03 11:15:02 +00:00
2017-12-03 13:27:35 +00:00
< p align = "center" >
2017-12-03 13:33:46 +00:00
< img src = "https://i.imgur.com/jBjNoKO.png" / >
2017-12-03 13:27:35 +00:00
< / p >
2017-12-03 13:14:30 +00:00
2018-05-31 17:33:22 +00:00
`updates` is a CLI tool which checks for npm dependency updates of the current project and optionally updates `package.json` . It is typically able to complete in less than a second.
2017-12-03 11:15:02 +00:00
2017-12-03 11:38:46 +00:00
## Install
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
```
2018-09-02 08:35:47 +00:00
# Usage
```
usage: updates [options]
Options:
2018-09-02 19:43:16 +00:00
-u, --update Update package.json
-p, --prerelease [< pkg , . . . > ] Consider prerelease versions
-j, --json Output a JSON object
-g, --greatest [< pkg , . . . > ] Prefer greatest over latest version
-i, --include < pkg , . . . > Only include given packages
-e, --exclude < pkg , . . . > Exclude given packages
-r, --registry < url > Use a custom registry
-f, --file < path > Use specified package.json file
-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
$ updates -u -e semver
2018-09-02 08:36:52 +00:00
```
2018-09-02 08:35:47 +00:00
2017-12-03 14:16:59 +00:00
## Examples
2018-09-02 08:35:47 +00:00
2017-12-03 16:08:01 +00:00
### Check for updates
2017-12-03 12:18:53 +00:00
```console
2017-12-03 11:15:56 +00:00
$ updates
2017-12-10 17:32:11 +00:00
NAME OLD NEW
2017-12-08 13:39:52 +00:00
chalk 1.3.0 2.3.0
got ^7.0.1 ^8.0.1
minimist ^1.0.0 ^1.2.0
2017-12-03 14:16:59 +00:00
```
2017-12-03 16:08:01 +00:00
### Update package.json
2017-12-03 14:16:59 +00:00
```console
2017-12-03 11:15:56 +00:00
$ updates -u
2017-12-10 17:32:11 +00:00
NAME OLD NEW
2017-12-08 13:39:52 +00:00
chalk 1.3.0 2.3.0
got ^7.0.1 ^8.0.1
minimist ^1.0.0 ^1.2.0
2018-07-24 17:47:29 +00:00
╭────────────────────────╮
│ package.json updated │
╰────────────────────────╯
2017-12-03 14:16:59 +00:00
```
2017-12-03 16:08:01 +00:00
### JSON Output
2017-12-08 13:39:52 +00:00
2018-06-11 18:04:58 +00:00
`updates` can output JSON. The result is always an object with the key `results` and depending on operation, `message` and `error` properties can also be present.
2017-12-08 13:39:52 +00:00
2017-12-03 16:05:35 +00:00
```console
$ updates -j
2017-12-08 13:39:52 +00:00
{
"results": {
"chalk": {
"old": "1.3.0",
"new": "2.3.0"
},
"got": {
"old": "^7.0.1",
"new": "^8.0.1"
},
"minimist": {
"old": "^1.0.0",
"new": "^1.2.0"
}
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