Run your package.json scripts without needing to call p/npm run
explicitly:
# Traditional
❯ npm run my-script
> @pjshell/zsh@0.0.2 my-script
success!
# Convenient
❯ my-script
zsh: command not found: my-script
pjshell: Unknown command - falling back to npm-script: my-script 👍
> @pjshell/zsh@0.0.2 my-script
success!
# Supports script-name variant convention
❯ lint:style
pjshell: Unknown command - falling back to npm-script: lint:style 👍
# Supports passing flags
❯ lint -- --format json
pjshell: Unknown command - falling back to npm-script: lint 👍
For now, jq is used to parse package.json files and must be installed. I might remove this requirement later…
# Manual
git clone https://github.com/binury/npm-script-shell-plugin pjshell && pushd $_;
cat <<PJ >> ~/.zshrc
# Load pjshell plugin
source $PWD/pjshell.zsh
PJ
popd;
# Plugin managers (e.g., antidote)
antidote bundle binury/npm-script-shell-plugin
- [ ] Suppress command-not-found error message if script matches
- [ ] Options for handling namespace conflicts (e.g.,
test
)