safe-publish-latest

Ensure that when you `npm publish`, the "latest" tag is only set for the truly latest version.


Keywords
publish, latest, npm, dist-tag, tag, safe, prepublish
License
MIT
Install
npm install safe-publish-latest@1.1.4

Documentation

safe-publish-latest Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

Ensure that when you npm publish, the "latest" tag is only set for the truly latest version.

Usage

Add "safe-publish-latest" to your package.json's "prepublish" script.

It will only activate during an actual npm publish - it will silently do nothing during installs, and will error when run directly.

Example package.json excerpt with no other prepublish commands:

{
	"scripts": {
		"prepublish": "safe-publish-latest"
	}
}

Example package.json excerpt with another prepublish command:

{
	"scripts": {
		"prepublish": "safe-publish-latest && npm run build"
	}
}

Tests

Simply clone the repo, npm install, and run npm test