JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 74127
  • Score
    100M100P100Q153418F
  • License MIT

Enable or disable npm postinstall hook

Package Exports

  • pinst

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 Node.js CI npm

pinst lets you have postinstall hook that runs only in dev 🍺

This can be useful if you want to automatically run commands just after npm install, but don't want your package users to be affected.

Usage

$ npm install pinst --save-dev
// package.json
{
  "scripts": {
    "postinstall": "<some dev only command>",
    "prepublishOnly": "pinst --disable",
    "postpublish": "pinst --enable"
  }
}
$ npm publish

On prepublishOnly, postinstall will be renamed to _postinstall (disabled)

On postpublish, 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

Try it

To test that everything works without actually publishing your package, you can manually run the following commands:

$ npm run prepublishOnly
$ npm run postpublish

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 🌵