Go to file
2023-04-23 23:35:27 +02:00
.github/workflows require node 16 2023-04-18 20:19:24 +02:00
fixtures support updating from 1- and 2-digit version ranges 2022-11-10 22:44:24 +01:00
.editorconfig misc tweaks 2022-08-25 01:13:46 +02:00
.eslintrc.yaml fix ignorepattern for eslint 8.27 2022-11-18 19:02:09 +01:00
.gitattributes enable multi-os travis 2019-08-20 21:49:57 +02:00
.gitignore ignore .DS_Store 2023-03-19 22:01:33 +01:00
.ignore bundle version into script 2022-09-26 00:17:29 +02:00
.npmrc switch to npm 2021-08-23 09:44:25 +02:00
Makefile exclude registry-auth-token 2023-04-23 23:35:27 +02:00
package-lock.json 14.0.1 2023-04-18 23:34:32 +02:00
package.json 14.0.1 2023-04-18 23:34:32 +02:00
README.md add config file, exclude semver 2023-04-23 23:33:16 +02:00
screenshot.png tweak screenshot 2020-07-14 23:05:32 +02:00
test.js use node protocol 2022-12-09 12:46:05 +01:00
updates.config.js exclude registry-auth-token 2023-04-23 23:35:27 +02:00
updates.js fix lint 2023-04-23 23:31:52 +02:00
vitest.config.js update deps 2023-04-18 01:14:02 +02:00

updates

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.

Usage

# check for updates
npx updates

# update package.json and install them
npx updates -u && npm i

Bun and Deno

bunx updates
deno run -A npm:updates

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 none is given, the option will be applied to all packages instead.

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
    -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
    -G, --githubapi <url>              Override Github API URL
    -f, --file <path>                  Use given package.json file or module directory
    -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
    -V, --verbose                      Print verbose output to stderr
    -h, --help                         Print this help

  Examples:
    $ updates
    $ updates -u && npm i

Config File

Put a updates.config.js or updates.config.mjs in the root of your project, usually besides package.json to configure certain options of the module. CLI arguments have precedence over them.

export default {
  exclude: [
    "semver",
  ],
};

Config Options

  • include []String: Array of dependencies to include
  • exclude []String: Array of dependencies to exclude
  • types []String: Array of dependency types

© silverwind, distributed under BSD licence