A CLI tool for managing package versioning, changelogs, and publishing across monorepos, driven by changeset files contributors add with their changes.
sindresorhus/np
A CLI that wraps npm publish with pre-release checks, version bumping, git tagging, tests and pushes, so releases are done in one interactive run.
- Stars
- 7,710
- Forks
- 311
- Open issues
- 7
- Last commit
- last month
What is it?
np is a command-line tool that replaces the usual manual sequence of publishing an npm package. Run it from a project and it checks that you are on the release branch, that the working directory is clean and up to date with the remote, and that your Node.js and npm versions match what the project supports. It then reinstalls dependencies, runs tests, bumps the version in package.json and package-lock.json, creates a git tag, and publishes to npm.
If publishing fails, np rolls the project back to its previous state. After a successful publish it pushes commits and tags to GitHub or GitLab and can open a prefilled GitHub Releases draft. It also blocks accidental publishing of pre-release versions under the latest dist-tag, supports two-factor authentication, and offers a dry-run mode that shows every step without executing it.
np works with npm, pnpm, Bun and Yarn, and can publish to GitHub Packages or a custom registry. It is designed for interactive local use rather than CI, and monorepos are not supported.
Key features
- 01Checks the release branch, clean working tree and unpulled changes before publishing.
- 02Bumps package.json and package-lock.json versions and creates a git tag.
- 03Runs tests and rolls back the project if publishing fails.
- 04Pushes commits and tags to GitHub or GitLab and can open a release draft.
- 05Offers an interactive UI and a dry-run mode.
- 06Supports npm, pnpm, Bun and Yarn, plus GitHub Packages.
Use cases
- Publishing a library to npm from a local machine with a consistent, checked release process.
- Standardizing releases across a team by adding np as a release script in package.json.
- Publishing pre-release versions under a separate dist-tag such as beta without risking the latest tag.
- Publishing a private package from a git repository by skipping the npm publish step.
Quick start
- 1
Install np globally with npm
npm install --global np - 2
Run np in your project and follow the interactive prompts
np
Things to know
- Monorepos are not supported.
- CI is not an ideal environment; it is meant to be used locally as an interactive tool.
- Requires Node.js 22 or later, npm 10 or later, and Git 2.11 or later.
Topics
FAQ
- What is np?
- A CLI that wraps npm publish with pre-release checks, version bumping, git tagging, tests and pushes, so releases are done in one interactive run. np is a command-line tool that replaces the usual manual sequence of publishing an npm package. Run it from a project and it checks that you are on the release branch, that the working directory is clean and up to date with the remote, and that your Node.js and npm versions match what the project supports. It then reinstalls dependencies, runs tests, bumps the version in package.json and package-lock.json, creates a git tag, and publishes to npm.
- Is np free to use? What license does it have?
- np is open source under the MIT license. Check the license terms before using it in commercial products.
- Is np still maintained?
- Updated within 6 months. The last commit to np was on Sep 9, 2026.
- What can I use np for?
- Publishing a library to npm from a local machine with a consistent, checked release process. Standardizing releases across a team by adding np as a release script in package.json. Publishing pre-release versions under a separate dist-tag such as beta without risking the latest tag. Publishing a private package from a git repository by skipping the npm publish step.
- How do I install np?
- Install np globally with npm: npm install --global np Run np in your project and follow the interactive prompts: np
- Where can I get np?
- The source code and installation instructions are on GitHub: https://github.com/sindresorhus/np
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A community-driven framework for managing zsh configuration, bundling hundreds of plugins and themes plus an update tool.
A Windows-first graphical interface that manages software installs and updates across WinGet, Scoop, Chocolatey, Homebrew, APT, pip, npm and more.
Offline C++ tool that removes visible Gemini watermarks from images via reverse alpha blending, with GUI, CLI and batch modes.
A collection of short, self-contained JavaScript articles and code snippets for learning everyday programming patterns in 30 seconds or less.
A JavaScript-based tool for writing shell-style scripts, wrapping child_process with safe argument escaping and cross-platform helpers.