Enable or disable npm postinstall hook
npm install 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
``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)_
pinst accepts the following flags:
``
--enable, -e Enable postinstall hook
--disable, -d Disable postinstall hook
--silent, -s
By inverting commands, you can also use pinst to enable postinstall for your users only and not yourself.
pinst also supports install` alias.
MIT - Typicode :cactus: