Package Exports
- pinst
- pinst/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pinst) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
pinst

pinstlets you havepostinstallhook 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
// package.json
{
"scripts": {
"postinstall": "<some dev only command>",
"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, -sTips
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 🌵