# is-published-to-npm

> Checks if a given package & version have been pushed to npm

Latest version **2.0.1** (published 2020-07-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install is-published-to-npm
pnpm add is-published-to-npm
yarn add is-published-to-npm
bun add is-published-to-npm
```

Provides the command `is-published-to-npm`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-07-14 |
| First published | 2015-08-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Patrick Quinn-Graham |
| Maintainers | patrick |

## Links

- npm: https://www.npmjs.com/package/is-published-to-npm
- Repository: https://github.com/thepatrick/is-published-to-npm
- Homepage: https://github.com/thepatrick/is-published-to-npm#readme
- Issues: https://github.com/thepatrick/is-published-to-npm/issues
- npm.io page: https://npm.io/package/is-published-to-npm

## Dependencies (1)

- [npm](https://npm.io/package/npm.md) ^6.14.6

## Recent versions

- 2.0.1 (latest) — 2020-07-14
- 2.0.0 — 2020-07-14
- 1.1.4 — 2015-09-18
- 1.1.3 — 2015-08-20
- 1.1.2 — 2015-08-20
- 1.1.1 — 2015-08-20
- 1.1.0 — 2015-08-19
- 1.0.1 — 2015-08-19
- 1.0.0 — 2015-08-19

## README

is-published-to-npm
===================

Is this version of this package published to npm yet?

Use as a cli tool:

``` bash
# 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:

``` javascript
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);
  });
```

---
_Source: https://npm.io/package/is-published-to-npm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
