conditionally publish/tag but do not consider a pre-existing version/tag as an exception


003.11.02 years ago4 years agoMinified + gzip package size for @kuhe-org/publish-why-dont-we in KB



npm install @kuhe-org/publish-why-dont-we

npx publish-why-dont-we or run main.js.

The script will do the following:


Find a prospective version. If the flag --use-latest-local-tag is used, then the latest local tag will be taken as the prospective version (unless the package.json version is higher)

In all other cases, the package.json version will be used as the prospective version.


Using this prospective version, the program will push a tag for this version only if it does not already exist on the remote.

It will also npm publish this version if and only if it does not already exist.

Existence of either a tag or npm version equal to the prospective version is not treated as a failure and instead ignored.


The suggested and designed use-case is running this command after automation has verified and merged a PR that may or may not bump the package.json version of a module.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.