pinst

3.0.0 • Public • Published

pinst Node.js CI npm

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

// 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, -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 🌵

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.066,494latest

Version History

VersionDownloads (Last 7 Days)Published
3.0.066,494
2.1.652,167
2.1.50
2.1.4199
2.1.31
2.1.20
2.1.1783
2.1.00
2.0.020
1.1.113
1.1.00
1.0.00

Package Sidebar

Install

npm i pinst

Weekly Downloads

119,677

Version

3.0.0

License

MIT

Unpacked Size

5.73 kB

Total Files

5

Last publish

Collaborators

  • typicode