npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

upgrade-node-modules

v1.4.0

Published

Lock down your module versions and upgrade to the latest stable versions when you want to

Downloads

1,755

Readme

upgrade-node-modules

Simple script to parse your package.json and upgrade each package version to latest stable.


New Features!

• You can now ignore modules entirely in fixedModules by specifying the module and "*" for the version.

ex:

"dependencies": {
  "cool-module-name": "*"
}

Install globally

Via npm

npm install --global upgrade-node-modules

Then cd into the root level of any node project and run:

upgrade-node-modules

By default, the script will walk your package.json and query npm for the latest stable versions of each package. Once found, the script will create a new clone of your package.json with the latest stable versions of each devDependency and dependency. The file is saved as new file package.json.new.


Options

Lock down module versions

The upgrade-node-modules script has the option of locking down any number of dependencies or devDependencies. All you need to do is add a file to your project's root directory name fixedModules.json. List dependencies and devDependencies in the same way you would in package.json

Example (json5):

{
  "dependencies": {
    // some comment here - these are filtered out on fixedModule load and JSON5 parsing
    "commander": "2.14.0",
    "chalk": "1.9.3"
  },
  "devDependencies": {
    // some other comment here"
    "mocha": "5.0.1"
  }
}

Standard json parsing is still fully supported.

Help

Display help.

upgrade-node-modules -h

Verbose

Display all console output.

upgrade-node-modules -v

Silent

Suppress all console output.

upgrade-node-modules -s

Overwrite

Overwrite your existing package.json with the new module versions (instead of creating a package.json.new).

upgrade-node-modules -w

Report

Print a log to stdout that shows a table of out-of-date packages with the currently installed version, the desired version (as defined in package.json), and the latest version (per npm).

upgrade-node-modules -r

File

Write the report to file (html). Super handy for uploading or emailing via automation.

upgrade-node-modules -f

File (JSON)

Write the report to file (json).

upgrade-node-modules -j

Upgrade

Automatically upgrades your node modules after running the dependency review. Note: selecting upgrade will automatically overwrite your package.json, essentially adding -w to the upgrade call.

Security Audit

Runs npm audit under the hood and will provide a before and after report when writing to file or console. Note: selecting audit will automatically produce a report (console if -f is not selected)

Fix Audit

Runs npm audit before and after upgrade and also runs npm audit --fix. If you have report output selected, a before and after audit report will be added. Additionally, if vulnerabilities were reported, a brief security progress report will be included in the report. Note: selecting fix audit will automatically overwrite your package.json, essentially adding -w to the fix audit call.


Thank you for taking a look at the project. Open an Issue if you find bugs, have an improvement, or caught a typo. Cheers!