# prevent-publish

> Prevent Accidental NPM publish

Latest version **0.0.4** (published 2017-04-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install prevent-publish
pnpm add prevent-publish
yarn add prevent-publish
bun add prevent-publish
```

Provides the command `pap`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2017-04-04 |
| First published | 2017-04-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Abraham jagadeesh |
| Maintainers | ajagad |
| Keywords | prevent npm, accidental npm, private modules |

## Links

- npm: https://www.npmjs.com/package/prevent-publish
- Repository: https://github.com/abrahamjagadeesh/prevent-publish
- Homepage: https://github.com/abrahamjagadeesh/prevent-publish.git#readme
- Issues: https://github.com/abrahamjagadeesh/prevent-publish/issues
- npm.io page: https://npm.io/package/prevent-publish

## Dependencies (1)

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

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.4 (latest) — 2017-04-04
- 0.0.3 — 2017-04-04
- 0.0.2 — 2017-04-03
- 0.0.1 — 2017-04-03

## README

## Prevent Accidental NPM publish

It is a pain when you accidentally published your private npm modules to Npm registry.
This module prevents this disaster.

### Installation

```
npm i -g prevent-publish

```

### Usage

Add the hook to the prepublish npm script of your package.json. 
By default, this prevents the module be published to `registry.npmjs.org`

```
  "scripts": {
    "prepublish": "pap"
  },
```

If you have installed local to your module.

```
  "scripts": {
    "prepublish": "node_modules/.bin/pap"
  },
```

If you want the modules be published only to certain registries

```
  "scripts": {
    "prepublish": "pap --whitelist=libraries.npmjs.org,registry.yarnpkg.com"
  },
```

If you don't want to the modules be published to certain registries

```
  "scripts": {
    "prepublish": "pap --blacklist=registry.yarnpkg.com"
  },
```

If you don't want to the modules be published to certain registries but allow them published to 
`registry.npmjs.org`

```
  "scripts": {
    "prepublish": "pap --any --blacklist=registry.yarnpkg.com"
  },
```

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