# contaazul-pinst

> Enable or disable npm postinstall hook

Latest version **1.1.10** (published 2025-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install contaazul-pinst
pnpm add contaazul-pinst
yarn add contaazul-pinst
bun add contaazul-pinst
```

Provides the command `ca-pinst`.

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.10 |
| Published | 2025-09-11 |
| First published | 2023-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=22.0.0 |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 0 |
| Maintainers | contaazul-admin, cirocfc |
| Keywords | npm, preinstall, postinstall, lifecycle, dev, devpreinstall, devpostinstall |

## Links

- npm: https://www.npmjs.com/package/contaazul-pinst
- Repository: https://github.com/ContaAzul/pinst
- Homepage: https://github.com/ContaAzul/pinst#readme
- Issues: https://github.com/ContaAzul/pinst/issues
- npm.io page: https://npm.io/package/contaazul-pinst

## Recent versions

- 1.1.10 (latest) — 2025-09-11
- 1.1.9 — 2025-09-10
- 1.1.8 — 2025-04-17
- 1.1.7 — 2025-04-17
- 1.1.6 — 2025-04-17
- 1.1.5 — 2025-04-17
- 1.1.4 — 2025-04-17
- 1.1.3 — 2025-04-17
- 1.1.2 — 2025-04-17
- 1.1.1 — 2025-04-17
- 1.1.0 — 2025-04-17
- 1.0.9 — 2025-04-17
- 1.0.8 — 2025-04-17
- 1.0.6 — 2025-04-17
- 1.0.5 — 2025-04-17
- … 4 more at https://npm.io/package/contaazul-pinst/versions

## README

# contaazul-pinst [![Checks](https://github.com/ContaAzul/pinst/actions/workflows/ci.yml/badge.svg)](https://github.com/ContaAzul/pinst/actions) [![npm](https://img.shields.io/npm/v/contaazul-pinst.svg)](https://www.npmjs.com/package/contaazul-pinst)

> `pinst` lets you have `preinstall` and `postinstall` hooks that runs only in dev 🍺

**Important** if your project is using npm or pnpm, you can achieve the desired effect by setting a `prepare` hook instead. `ca-pinst` is mainly useful for Yarn 2+ since it doesn't support `prepare` hook. See https://yarnpkg.com/advanced/lifecycle-scripts

## Usage

```js
// package.json
{
  "scripts": {
    "preinstall": "<some dev only command>",
    "postinstall": "<some dev only command>",
    "prepack": "ca-pinst --disable",
    "postpack": "ca-pinst --enable"
  }
}
```

**On `prepack`, `(pre|post)install` will be renamed to `_(pre|post)install` (disabled)**

**On `postpack`, it will be renamed back to `(pre|post)install` (enabled)**

## CLI

`ca-pinst` accepts the following flags:

```txt
--enable, -e   Enable postinstall hook
--disable, -d  Disable postinstall hook
--silent, -s
```

## Tips

By inverting commands, you can also use `ca-pinst` to enable `preinstall` and `postinstall` for your users only and not yourself.

`ca-pinst` also supports `install` alias.

## License

MIT - [ContaAzul :cactus:](https://github.com/ContaAzul)

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