sindresorhus/np

A better `npm publish`

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 39 minutes ago
Added to GitGenius on September 8th, 2026
Created on August 16th, 2015
Open Issues & Pull Requests: 4 (+0)
GitHub issues: Enabled
Number of forks: 311
Total Stargazers: 7,713 (+0)
Total Subscribers: 30 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Issue API getrepoissuespagesummary failed: 429 Rate limit exceeded. Please try again later.

Detailed Description

np is a command-line tool that streamlines the npm package publishing workflow by automating and safeguarding the release process.

The tool solves the problem of error-prone manual npm publishing by orchestrating a comprehensive sequence of checks and operations. It ensures you are publishing from the correct branch, verifies the working directory is clean with no unpulled changes, reinstalls dependencies to validate the dependency tree, confirms Node.js and npm versions meet project requirements, runs tests, bumps the version in package.json and package-lock.json, creates git tags, prevents accidental publication of pre-release versions under the latest dist-tag, publishes to npm with optional dist-tag support, and pushes commits and tags to GitHub or GitLab. The tool includes two-factor authentication support, can open a prefilled GitHub Releases draft after publishing, warns about extraneous files, and offers dry-run mode to preview actions without making remote changes.

The tool is designed for individual developers and small teams publishing packages locally as an interactive workflow. It works with npm, pnpm, Bun, and Yarn in both Classic and Berry variants, and supports GitHub Packages for alternative registries. The README explicitly notes that monorepos are not supported and that the tool is not intended for CI environments, as it is built as an interactive local utility. Developers should choose this tool if they want to eliminate manual steps and reduce the risk of publishing mistakes during the release process.

The project maintains active engagement with issues and feature requests, demonstrating responsiveness to user needs and problems encountered in real-world usage. Development activity shows consistent refinement of the publishing workflow based on practical feedback from the community.