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 🙏

© 2026 – Pkg Stats / Ryan Hefner

batch-upgrade-npm-packages

v1.1.0

Published

A CLI tool to upgrade npm packages across multiple repositories with automatic PR creation

Readme

Batch Upgrade NPM Packages

A command-line tool to upgrade npm packages across multiple repositories with automatic PR creation.

npm version

Features

  • Update npm packages across multiple repositories in one go
  • Create unique branches for changes in each repository
  • Create pull requests automatically for code review
  • Verify package installation with both force and regular installs
  • Skip packages already at or above the requested version
  • Command-line and interactive modes
  • Colorful terminal output for better visibility

Requirements

  • Node.js 14 or higher
  • Git
  • GitHub CLI (gh) - Must be authenticated before running
  • npm

Installation

Global Installation (Recommended)

npm install -g batch-upgrade-npm-packages

Project Installation

npm install batch-upgrade-npm-packages

Authentication Setup

Before using this tool, you need to authenticate with GitHub CLI:

gh auth login

Follow the prompts to complete the authentication process.

Usage

Interactive Mode

The easiest way to use this tool is in interactive mode:

batch-upgrade-npm -i

This will guide you through the process with prompts for:

  1. Packages to update (space-separated)
  2. Version ranges (space-separated, matching package order)
  3. Repository paths (space-separated, relative to current directory)

Command Line Mode

You can also provide all parameters on the command line:

batch-upgrade-npm -p package1 package2 -v "^1.0.0" "^2.0.0" -r repo1 repo2

Where:

  • -p, --packages: Space-separated list of packages to update
  • -v, --versions: Space-separated list of version ranges (must match packages in order)
  • -r, --repos: Space-separated list of repository paths relative to current directory

Examples

Update multiple packages in multiple repositories:

batch-upgrade-npm -p @company/pkg1 @company/pkg2 -v "^1.0.0" "^2.2.1" -r repo1 repo2

Update a single package in a single repository:

batch-upgrade-npm -p react -v "^18.0.0" -r my-app

How It Works

For each repository, the tool will:

  1. Check out the main branch and pull latest changes
  2. Create a new branch for package updates
  3. Update the specified packages to their target versions
    • Skip packages not found in the repository
    • Skip packages already at or above the requested version
  4. Verify installations using:
    • Remove node_modules directory for a clean environment
    • First attempt with 'npm install --force'
    • Remove node_modules again
    • Second verification with regular 'npm install'
  5. Commit changes if any updates were made
  6. Push the branch to origin
  7. Create a pull request with details of the updates (only if changes were made)

Safety Features

  • Will not commit directly to main branch
  • Discards any uncommitted changes in repositories
  • Validates GitHub CLI authentication before proceeding
  • Creates descriptive pull requests for review before merging
  • Cleans up branches if no changes were made
  • Double verification of package installations
  • Clean node_modules removal before installations
  • Skips updating packages that are already up-to-date
  • Skips creating PRs when no changes were made

License

MIT