A barebones NPM bulk publisher.

Usage no npm install needed!

<script type="module">
  import massPublish from '';



A barebones bulk NPM publisher.

Getting Started

You can install the CLI from NPM as a devDependency for your project.

npm install mass-publish -D

Then automatically generate mass-publish.json which will be used as the main configuration. It will also keep track of the last published commit for detecting changes.

npx mass-publish init


    packages: ["packages/"], // Directories to check for changes
    ignoreExtension: [".json"], // Ignore differneces with file extension of a certain type (Optional)
    commitMessage: "chore: release new versions", // Commit message on publish
    git: { // Git credentials (optional as it should try finding system gitconfig)
        name: "DecliningLotus",
        email: "",
    commitFrom: "fullsha", // Commit SHA to compare differences from. This is automatically updated on every publish
    commitTo: "fullsha", // Commit SHA to compare differences to. Default is the head commit (Optional)
    noVerify: false, // Refer to changed command flag
    autobump: false, // Refer to bump command flag
    yes: false, // Refer to bump command flag

Reference: config.ts

Environment variables

These can be saved in a .env file or through your CI modifying process.env as secrets.




mass-publish init

Creates mass-publish.json with default variables in the root folder.


mass-publish changed

Runs git diff and lists all packages that have changes made to them.


  • changed --commit-from=fullgitsha - Commit SHA to compare differences from
  • changed --commit-to=fullgitsha - Commit SHA to compare differences to
  • changed --commit-message="commit message" - Change commit message
  • changed --ignore-extension=.js,.ts - Ignore extensions
  • changed --packages=./packages - Package directory


mass-publish bump patch|minor|major|1.0.0

Bumps the package.json of changed packages. A bump argument must be provided that follows semver.


  • bump patch --no-verify - Skips verifying with NPM registry whether the package version isn't taken.
  • bump major --force-publish - Force bump ALL packages regardless if changed or not.
  • bump 1.2.3 --yes - Skips confirmation to write the bump changes to package.json. Useful in CI.

All previous flags from mass-publish changed can be also be used.


mass-publish publish patch|minor|major|1.0.0

Publishes all packages to NPM.


All previous flags from changed and bump can be used.

How It Works

  1. Use Git to compare the last known mass-publish commit (or custom hash) with the latest commits and determine the changes from the diff.
  2. Bump packages and validate they are publishable by comparing versions on the NPM registry using package-json.
  3. Use pacote and libnpmpublish to pack and publish the packages using an async queue.