1. pinst
Enable or disable npm postinstall hook
pinst
Package: pinst
Created by: typicode
Last modified: Fri, 09 Jun 2023 21:36:51 GMT
Version: 3.0.0
License: MIT
Downloads: 237,013
Repository: https://github.com/typicode/pinst

Install

npm install pinst
yarn add pinst

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 :cactus:

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin