VibeHunt
Back to browse

np

A better `npm publish`.

Source

It provides an interactive command‑line workflow for publishing a Node.js package, handling common safety checks before the actual npm publish. The tool verifies that the current branch is a designated release branch, that the working tree is clean, and that dependencies are reinstalled to match the latest lockfile. It also checks Node and npm version compatibility, runs the project’s test script, bumps the version in package.json (and npm‑shrinkwrap.json if present), creates a git tag, and pushes commits and tags to the remote repository.

If publishing succeeds, it publishes the new version to the npm registry (or an alternative registry such as GitHub Packages), optionally under a specified dist‑tag, and can open a prefilled GitHub Releases draft. In case of failure it rolls back the repository to its previous state. The command supports dry‑run mode, two‑factor authentication setup, and provenance statements, and works with npm 9+, Yarn, pnpm 8+, and Bun.

Configuration can be supplied globally via a .np‑config file in the user’s home directory or locally through a np field in package.json or a config file in the project. Flags such as branch name, cleanup behavior, test execution, and release‑draft handling are adjustable, allowing developers to tailor the publishing process to their workflow.

Reviews

Sign in to leave a review.

Loading reviews…

Similar apps