xen-orchestra/@vates/toggle-scripts
Julien Fontanet 3f42199f8f feat(normalize-packages): dont use files field
A centralized npmignore is easier to use and maintain.
2021-04-23 14:47:34 +02:00
..
.npmignore feat: unified .npmignore for all packages 2021-04-07 13:58:14 +02:00
index.js feat(toggle-scripts): supports npm < 7 2021-02-24 08:54:29 +01:00
package.json feat(normalize-packages): dont use files field 2021-04-23 14:47:34 +02:00
README.md fix(toggle-scripts): fix usage 2021-02-23 21:54:31 +01:00
USAGE.md fix(toggle-scripts): fix usage 2021-02-23 21:54:31 +01:00

@vates/toggle-scripts

Package Version License PackagePhobia Node compatibility

Easily enable/disable scripts in package.json

Install

Installation of the npm package:

> npm install --save @vates/toggle-scripts

Usage

Usage: toggle-scripts options...

  Easily enable/disable scripts in package.json

  Options
    +<script>    Enable the script <script>, ie remove the prefix `_`
    -<script>    Disable the script <script>, ie prefix it with `_`

  Examples
    toggle-scripts +postinstall +preuninstall
    toggle-scripts -postinstall -preuninstall

For example, if you want postinstall hook only in dev:

// package.json
{
  "scripts": {
    "postinstall": "<some dev only command>",
    "prepublishOnly": "toggle-scripts -postinstall",
    "postpublish": "toggle-scripts +postinstall"
  }
}

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

License

ISC © Vates SAS