is-published-to-npm
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

is-published-to-npm

Is this version of this package published to npm yet?

Use as a cli tool:

# from a directory with a package.json
is-published-to-npm
 
# or for any package
is-published-to-npm {your package} {your version}

(Check the exit status - anything not zero means it has already been published)

Or as a module:

const { isPublishedToNPM } = require('is-published-to-npm');
// or import { isPublishedToNPM } from 'is-published-to-npm';
 
const pkg = process.argv[2];
const version = process.argv[3];
 
isPublishedToNPM(pkg, version)
  .then(published => {
    if (published) {
      console.log(pkg + ' v' + version + ' has been published');
      process.exit(1);
    } else {
      console.log(pkg + ' v' + version + ' has not been published yet');
    }
  })
  .catch(err => {
    console.log(err.message);
    process.exit(1);
  });

Readme

Keywords

none

Package Sidebar

Install

npm i is-published-to-npm

Weekly Downloads

0

Version

2.0.1

License

ISC

Unpacked Size

13.3 kB

Total Files

17

Last publish

Collaborators

  • patrick