Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/typicode/pinst
🍺 dev only postinstall hooks (package.json)
https://github.com/typicode/pinst
dev hook hooks npm pnpm postinstall production yarn
Last synced: about 16 hours ago
JSON representation
🍺 dev only postinstall hooks (package.json)
- Host: GitHub
- URL: https://github.com/typicode/pinst
- Owner: typicode
- License: mit
- Created: 2018-06-08T00:34:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T02:55:58.000Z (almost 2 years ago)
- Last Synced: 2025-01-01T06:08:12.012Z (8 days ago)
- Topics: dev, hook, hooks, npm, pnpm, postinstall, production, yarn
- Language: JavaScript
- Homepage:
- Size: 428 KB
- Stars: 260
- Watchers: 4
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# pinst [![Node.js CI](https://github.com/typicode/pinst/workflows/Node.js%20CI/badge.svg)](https://github.com/typicode/pinst/actions) [![npm](https://img.shields.io/npm/v/pinst.svg)](https://www.npmjs.com/package/pinst)
> `pinst` lets you have `postinstall` hook 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. `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": {
"postinstall": "",
"prepack": "pinst --disable",
"postpack": "pinst --enable"
}
}
```_On `prepack`, `postinstall` will be renamed to `_postinstall` (disabled)_
_On `postpack`, it will be renamed back to `postinstall` (enabled)_
## CLI
`pinst` accepts the following flags:
```
--enable, -e Enable postinstall hook
--disable, -d Disable postinstall hook
--silent, -s
```## Tips
By inverting commands, you can also use `pinst` to enable `postinstall` for your users only and not yourself.
`pinst` also supports `install` alias.
## License
MIT - [Typicode :cactus:](https://github.com/typicode)