updates/README.md

89 lines
3.2 KiB
Markdown
Raw Normal View History

2017-12-03 11:15:02 +00:00
# updates
2023-04-18 21:29:08 +00:00
[![](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://packagephobia.com/badge?p=updates)](https://packagephobia.com/result?p=updates)
2019-03-07 20:23:03 +00:00
2020-07-14 20:57:33 +00:00
![](./screenshot.png)
2019-03-07 20:23:03 +00:00
`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
# Usage
2020-04-07 15:43:13 +00:00
```bash
2023-04-18 21:29:08 +00:00
# check for updates
npx updates
2023-04-18 21:29:08 +00:00
# update package.json and install them
npx updates -u && npm i
```
2023-04-18 21:29:08 +00:00
## Bun and Deno
2020-04-07 15:43:13 +00:00
```bash
2023-04-18 21:29:08 +00:00
bunx updates
deno run -A npm:updates
2019-07-12 14:38:41 +00:00
```
2019-07-12 14:37:24 +00:00
2019-03-07 20:23:03 +00:00
## Options
2019-03-07 20:28:20 +00:00
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 none is given, the option will be applied to all packages instead.
2019-03-07 20:23:03 +00:00
2018-09-02 08:35:47 +00:00
```
usage: updates [options]
Options:
-u, --update Update versions and write package.json
-p, --prerelease [<pkg,...>] Consider prerelease versions
-R, --release [<pkg,...>] Only use release versions, may downgrade
-g, --greatest [<pkg,...>] Prefer greatest over latest version
-i, --include <pkg,...> Include only given packages
-e, --exclude <pkg,...> Exclude given packages
-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
-d, --allow-downgrade [<pkg,...>] Allow version downgrades when using latest version
2020-04-07 15:44:57 +00:00
-E, --error-on-outdated Exit with code 2 when updates are available and 0 when not
-U, --error-on-unchanged Exit with code 0 when updates are available and 2 when not
-r, --registry <url> Override npm registry URL
2020-03-09 16:55:59 +00:00
-G, --githubapi <url> Override Github API URL
-f, --file <path> Use given package.json file or module directory
2020-04-07 15:44:57 +00:00
-S, --sockets <num> Maximum number of parallel HTTP sockets opened. Default: 96
-j, --json Output a JSON object
-n, --no-color Disable color output
-v, --version Print the version
2020-10-20 19:04:33 +00:00
-V, --verbose Print verbose output to stderr
-h, --help Print this help
2018-09-02 08:35:47 +00:00
Examples:
$ updates
2023-04-18 21:29:08 +00:00
$ updates -u && npm i
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
2018-12-02 08:20:31 +00:00
The JSON output is an object with possible properties `results`, `message` and `error`:
2021-12-02 13:45:51 +00:00
```bash
2020-07-14 21:29:14 +00:00
updates -j | jq
{
"results": {
"dependencies": {
2020-03-08 16:13:23 +00:00
"p-map": {
"old": "3.0.0",
"new": "4.0.0",
"info": "https://github.com/sindresorhus/p-map",
"age": "3 days"
}
},
"devDependencies": {
"eslint": {
2020-03-08 16:13:23 +00:00
"old": "6.7.2",
"new": "6.8.0",
"info": "https://github.com/eslint/eslint",
"age": "3 months"
}
}
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