UNPKG

2.39 kBMarkdownView Raw
1# updates
2[![](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)
3
4![](./screenshot.png)
5
6`updates` is a CLI tool which checks for npm and poetry dependency updates of the current project and optionally updates `package.json`/`pyproject.toml`. It is highly configurable and is typically able to complete in less than a second.
7
8# Usage
9
10With Node.js:
11
12```bash
13# check for updates
14npx updates
15
16# update package.json and install new dependencies
17npx updates -u && npm i
18```
19
20With Bun:
21
22```bash
23# check for updates
24bunx updates
25
26# update package.json and install new dependencies
27bunx updates -u && bun i
28```
29
30## Options
31
32See `--help`. Options that take multiple arguments can take them either via comma-separated value or by specifying the option multiple times.
33
34If an option has a optional `pkg` argument but none is given, the option will be applied to all packages instead.
35
36All `pkg` options support glob matching via [picomatch](https://github.com/micromatch/picomatch) or regex (on CLI, wrap the regex in slashes, e.g. `'/^foo/'`).
37
38## Notes
39
40The module uses global `fetch` under the hood. In Node.js HTTP proxies from environment are [not supported](https://github.com/nodejs/undici/issues/1650), but it's still possible to enable `updates` to use them by installing the `undici` dependency into your project.
41
42## Config File
43
44The config file is used to configure certain options of the module. CLI arguments have precedence over options in the config file, except for `include` and `exclude` options which are merged.
45
46```js
47export default {
48 exclude: [
49 "semver",
50 "@vitejs/*",
51 /^react(-dom)?$/,
52 ],
53};
54```
55
56### Config File Locations
57
58The config file can be placed in these locations, relative to `package.json`:
59
60- `updates.config.js`
61- `updates.config.mjs`
62- `.config/updates.js`
63- `.config/updates.mjs`
64
65### Config File Options
66
67- `include` *Array[String|Regexp]*: Array of dependencies to include
68- `exclude` *Array[String|Regexp]*: Array of dependencies to exclude
69- `types` *Array[String]*: Array of dependency types
70- `registry` *String*: URL to npm registry
71
72© [silverwind](https://github.com/silverwind), distributed under BSD licence