This package has been deprecated

Author message:

'pinst' now has even less dependencies. Use it instead.

pinst-lite

2.2.0 • Public • Published

pinst-lite Node.js CI npm

pinst-lite 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.

Alternatively, you can also use it the other way around and prevent postinstall hook to run in dev.

This is a fork of pinst package with a smaller dependency graph which is achieved by using alternative depepndencies.

While this can be used as a drop-in replacement for pinst, there is no guarantee that your build won't break. Use with caution!

Usage

$ npm install pinst-lite --save-dev
// package.json
{
  "scripts": {
    "postinstall": "...",
    // Add pinst to npm publish hooks
    "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-lite accepts the following flags

--enable, -e   Enable postinstall hook
--disable, -d  Disable postinstall hook
--silent, -s

Try it

You can test that everything works, without actually publishing your package, by manually running the following commands

npm run prepublishOnly # Check package.json
npm run postpublish    # Check package.json

Tips

By inverting commands, you can also use pinst-lite to enable postinstall for your users only and not yourself.

pinst-lite also supports install alias.

License

MIT - Nikita Karamov MIT - Typicode 🌵

Dependencies (5)

Dev Dependencies (9)

Package Sidebar

Install

npm i pinst-lite

Weekly Downloads

1

Version

2.2.0

License

MIT

Unpacked Size

7.14 kB

Total Files

6

Last publish

Collaborators

  • nickkaramoff
  • kytta