1.1.0 • Published 4 years ago
safe-publish-tag v1.1.0
safe-publish-tag
Get the safe publish tag when you npm publish
.
Original requirement come from "Prevent accidental backwards publishing of latest"
Install
$ npm i safe-publish-tag --save
Example
const safePublishTag = require('safe-publish-tag');
safePublishTag('debug', '3.2.5')
.then(tag => {
console.log(tag);
});
// 'latest-3'
safePublishTag('debug', '4.10.0')
.then(tag => {
console.log(tag);
});
// or 'latest' if version greater than the current latest version on npm
Use your custom registry
safePublishTag('debug', '4.10.0', { registry: 'https://registry.npm.taobao.org' })
.then(tag => {
console.log(tag);
});
Questions & Suggestions
Please open an issue here.