Fast npm dependency updating tool
Clone or download
Latest commit d2f7bd6 Dec 28, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig init Dec 3, 2017
.eslintrc don't return 255 code any more, misc tweaks May 31, 2018
.gitignore init Dec 3, 2017
.travis.yml update .travis.yml Jan 23, 2018
LICENSE tweaks Dec 3, 2017
Makefile update make tasks Oct 15, 2018
README.md breaking: remove --semver option, add --patch and --minor instead - f… Dec 21, 2018
package.json 6.0.3 Dec 28, 2018
updates.js ignore greater versions when looking for latest Dec 28, 2018

README.md

updates

Fast npm dependency updating tool

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.

Install

$ npm i -g updates

Usage

usage: updates [options]

  Options:
    -u, --update                  Update versions and write package.json
    -p, --prerelease [<pkg,...>]  Consider prerelease versions
    -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
    -E, --error-on-outdated       Exit with error code 2 on outdated packages
    -r, --registry <url>          Use given registry URL
    -f, --file <path>             Use given package.json file or module directory
    -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

  Examples:
    $ updates
    $ updates -u
    $ updates -u -e chalk
    $ updates -u -s minor
    $ updates -u -t devDependencies

Examples

Check for updates

$ 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

Update package.json

$ 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
╭────────────────────────╮
│  package.json updated  │
╰────────────────────────╯

JSON Output

The JSON output is an object with possible properties results, message and error:

$ 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"
    }
  }
}

© silverwind, distributed under BSD licence