1.1.0 • Published 4 years ago

safe-publish-tag v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

safe-publish-tag

NPM version build status Build Status Test coverage Known Vulnerabilities npm download

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.

License

MIT