You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

npm-upgrade

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-upgrade

Interactive CLI utility to easily update outdated NPM dependencies

1.0.1
Source
npmnpm
Version published
Weekly downloads
2.9K
-10.25%
Maintainers
1
Weekly downloads
 
Created
Source

npm-upgrade

Interactive CLI utility to easily update outdated NPM dependencies with changelogs inspection support.

NPM version Downloads

What is this for?

If you are tired of manually upgrading package.json every time your package dependencies are getting out of date then this utility is for you.

Take a look at this demo:

npm-upgrade outdated packages

Installation

First, install Node.js (at least v0.10).

Then install this utility as global npm-module:

npm i -g npm-upgrade

Usage

Run npm-upgrade [filter] [options] in the root directory of your Node.js project (it must contain package.json that you want to update):

cd ~/my-projects/my-node-project
npm-upgrade

Utility will find all of your outdated deps and ask to update them in package.json. Just answer the questions and you are done.

If you want to check only some deps, you can use filter argument:

# Will check only `babel-core`:
npm-upgrade babel-core

# Will check all the deps with `babel` in the name:
npm-upgrade '*babel*'

# Note quotes around `filter`. They are necessary because without them bash may interpret `*` as wildcard character.

# Will check all the deps, excluding any with `babel` in the name:
npm-upgrade '!*babel*'

# You can combine including and excluding rules:
npm-upgrade '*babel* !babel-transform-* !babel-preset-*'

Use Ctrl-C to exit if you changed your mind.

Options

-h, --help         output usage information
-V, --version      output the version number
-p, --production   Check only "dependencies"
-d, --development  Check only "devDependencies"
-o, --optional     Check only "optionalDependencies"

Troubleshooting

Wrong changelog shown for <moduleName> or not shown at all!

Yes, It can happen sometimes. This is because there is no standardized way to specify changelog location for the module, so it tries to guess it, using these rules one by one:

  • Check db/changelogUrls.json from master branch on GitHub or the local copy if it's unreachable.
  • Check changelog field from module's package.json.
  • Parse module's repository.url field and if it's on GitHub, try to request some common changelog files (CHANGELOG.md, History.md etc.) from master branch and if it fails, open Releases page.

So, if it guessed wrong it would be great if you could either fill an issue about this or submit a PR which adds proper changelog URL to db/changelogUrls.json. There is a tool in the repository for you to make it as easy as possible:

./tools/addModuleChangelogUrlToDb.js <moduleName> <changelogUrl>

License

MIT

Keywords

npm

FAQs

Package last updated on 11 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.