Publishing Packages in NPM
From the NPM Package Manager cheat sheet ยท Publishing & Versioning ยท verified Jul 2026
Publishing Packages
Publish to NPM registry
bash
# Login to registry
npm login
npm whoami # Verify login
# Publish package
npm publish
# Publish with tag
npm publish --tag beta
npm publish --tag next
# Publish scoped package publicly
npm publish --access public
# Dry run (see what would publish)
npm publish --dry-run
# Pack for inspection
npm pack # Creates .tgz file๐ข Essential for package authors
๐ก Use --dry-run to preview before publishing
โ ๏ธ Unpublish only works within 72 hours
๐ Use "files" field to control published files
๐ Related: np package for easier publishing
publishregistry