1. can-npm-publish
A command line tool that check to see if `npm publish` is possible.
can-npm-publish
Package: can-npm-publish
Created by: azu
Last modified: Tue, 12 Apr 2022 05:09:12 GMT
Version: 1.3.6
License: MIT
Downloads: 45,986
Repository: https://github.com/azu/can-npm-publish

Install

npm install can-npm-publish
yarn add can-npm-publish

can-npm-publish Actions Status: test

A command line tool that check to see if npm publish is possible.

Check list

All check list is passed, exit status will be 0.

  • [x] Check that the package's name is valid
  • [x] Check that the package is not private:true
  • [x] Check that package@version is already published in npm registry

Install

Install with npm:

npm install can-npm-publish

Usage

Usage
  $ can-npm-publish [directory|package.json path]

Options
  --verbose  show detail of errors

Examples
  $ can-npm-publish
  $ echo $? # 0 or 1

All check list is passed, exit status will be 0.
If has any error, exit status will be 1.

If you want to know details of the error, you can use --verbose flag.

$ can-npm-publish --verbose
[email protected] is already published
$ echo $?
1

UseCase

Run can-npm-publish before npm publish:

can-npm-publish && npm publish

You can use it for publishing without choice.

For example, it is useful for using with lerna.

Publish all packages if it is possible.

lerna exec --bail=false -- "can-npm-publish && npm publish"

In this use-case, you should use @monorepo-utils/publish instead of can-npm-publish.
Because, @monorepo-utils/publish wrapped can-npm-publish.

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin