updates/README.md

96 lines
3.4 KiB
Markdown
Raw Normal View History

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">
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
`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-10-16 15:24:05 +00:00
-u, --update Update versions and write package.json
-p, --prerelease [<pkg,...>] Consider prerelease versions
-g, --greatest [<pkg,...>] Prefer greatest over latest version
2018-10-16 15:24:05 +00:00
-i, --include <pkg,...> Include only given packages
-e, --exclude <pkg,...> Exclude given packages
2018-10-16 15:24:05 +00:00
-t, --types <type,...> Check only given dependency types
-P, --patch [<pkg,...>] Consider only up to semver-patch
-m, --minor [<pkg,...>] Consider only up to semver-minor
-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
-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
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
NAME OLD NEW INFO
string-width 2.1.1 3.0.0 https://github.com/sindresorhus/string-width
eslint 5.9.0 5.10.0 https://github.com/eslint/eslint
eslint-config-silverwind 2.0.11 2.0.12 https://github.com/silverwind/eslint-config-silverwind
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
NAME OLD NEW INFO
string-width 2.1.1 3.0.0 https://github.com/sindresorhus/string-width
eslint 5.9.0 5.10.0 https://github.com/eslint/eslint
eslint-config-silverwind 2.0.11 2.0.12 https://github.com/silverwind/eslint-config-silverwind
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
2018-12-02 08:20:31 +00:00
The JSON output is an object with possible properties `results`, `message` and `error`:
2017-12-03 16:05:35 +00:00
```console
2018-10-25 20:36:41 +00:00
$ updates -j | jq
{
"results": {
"string-width": {
"old": "2.1.1",
"new": "3.0.0",
"info": "https://github.com/sindresorhus/string-width"
},
"eslint": {
"old": "5.9.0",
"new": "5.10.0",
"info": "https://github.com/eslint/eslint"
},
"eslint-config-silverwind": {
"old": "2.0.11",
"new": "2.0.12",
"info": "https://github.com/silverwind/eslint-config-silverwind"
}
2017-12-03 16:05:35 +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