Display the description of your npm scripts.
This module is installed via npm:
npm install npm-scripts-info --save
Add the descriptions (
scripts-info) to your
package.json. Afterwards, add
npm-scripts-info to your scripts.
npm run info.
Usings scripts prefixed with
For modules with dozens of scripts it might be a better option to store the descriptions near the commands.
npm-scripts-info allows to store the scripts descriptions in the
scripts property. In order to add a script description, just prefix its name with
Have you noticed the
echo command in the
start description? Hence the descriptions are inside the script property, they can be called using
npm run. By adding the
echo command to the description properties you can make valid scripts from them. Therefore, running
npm run ?start will print the description of the
start script. And the great thing is,
npm-scripts-info is smart enough to fetch the description from the
NOTE: The prefixed commands will be looked up for descriptions only if the
package.json doesn't have a
You can customize the output by specifying a reporter.
You can check the default reporter to get the gist of how it works. It's very simple.
Note: If you're publishing your own reporter, please prefix it with
npm-scripts-info-my-reporter) for searchability.
You can fetch the scripts descriptions from a
'use strict';var getScriptsInfo = ;var readPkgUp = ;;
Some of the npm scripts are standardized.
npm-scripts-info provides default descriptions for them, if no custom description specified in
- info - Display information about the scripts
- start - Kickstart the application
- test - Run the tests
- build - Build the package
- watch - Watch codebase, trigger build when source code changes
- cover - Execute test coverage
ISC © Kier Borromeo
- chalk: Terminal string styling done right. Much color.
- meow: CLI app helper
- unquote: Remove wrapping quotes from a string.
- chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
- mocha: simple, flexible, fun test framework
- mock-fs: A configurable mock file system. You know, for testing.
- read-pkg-up: Read the closest package.json file
- rewire: Easy dependency injection for node.js unit testing