npm-package-user-scripts-list
List all available npm script commands listed in scripts
section of
package.json
located in current (usually project root) folder.
Lists only items preceeded by echo --<Some description text>-- && <...>
commands from scripts
section or any items with title
property from
npm-package-user-scripts
section. npm-package-user-scripts
section also may
contain special default item (with id __default__
, if not redefined in
options parameter; TODO).
Commands with keys ends with *-UNUSED
or *-SAMPLE
strings are excluded.
In next example commands command-SAMPLE
, command-UNUSED
and
skipped-command
are ignored, npm-package-user-scripts-command
uses echo Overrided command
(which specified in npm-package-user-scripts
section) and
all commands has someCommonParameter
property:
"npm-package-user-scripts": , "scripts":
Installation
For current project:
$ npm i -S npm-package-user-scripts-list
Or global:
$ npm i -g npm-package-user-scripts-list
Usage
In javascript code:
const scriptsList = ; // Get script commandsconst scriptCommands = scriptsList; // Print command names to consoleObject;
From shell command line:
$ npm-package-user-scripts-list
Add command shortcut to package.json
:
"scripts":
Sample command line line result:
$ npm-package-user-scripts-list Available commands