npm-tabs
An autocompletion shell script that autocompletes the commands based on the scripts declared in the package.json file.
Dependencies required
- Jq
- Terminal that runs shell script (Support for windows under development)
Running
- After installing the package , use the following command in the root folder of your application
cd node_modules/npm-tabs ; tr -cd '[:alnum:][:blank:][:punct:]\n' < npm-tabs.sh > npm-tabs-min.sh ; source npm-tabs-min.sh
- It should automatically install the necessary dependencies
If it says 'source' is not recognized as an internal or external command. Try running the command from a bash terminal
cygWin - https://www.cygwin.com/
git - https://git-scm.com/download/win
- Now while typing npm run (default command to run npm scripts) press tab to show the list of suggested commands
Snippets
Get the npm script names as an array
sample=`cat package.json`arr=arr=
Autocomplete based on the array
Output