npm-script-help
Utility to document npm scripts
Installation
npm install npm-script-help -g # or
npm install npm-script-help --save-dev
Usage
Add a scriptHelp
config object to your package.json
{
"scripts": {
"start": "nodemon server.js"
},
"scriptHelp": {
"start": {
"usage": [
"NODE_ENV=development $0",
"NODE_ENV=production $0"
],
"desc": "Starts the server (or some more useful description)"
}
}
}
Run:
npm-help # In your project root
We suggest adding a script to your package.json
{
"scripts": {
"help": "npm-help"
}
}
Run:
npm run help
Outputs:
Script Usage Description
start NODE_ENV=development npm start Starts the server (or some more useful
NODE_ENV=production npm start description)