@pjshell/zsh
v0.0.3
Published
[IN DEVELOPMENT] Run package.json scripts directly by name
Downloads
7
Readme
pjshell - package.json script shell
Run your package.json scripts without needing to call p/npm run
explicitly:
# Traditional
❯ npm run my-script
> @pjshell/[email protected] my-script
success!
# Convenient
❯ my-script
zsh: command not found: my-script
pjshell: Unknown command - falling back to npm-script: my-script 👍
> @pjshell/[email protected] 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 👍
Requirements
For now, jq is used to parse package.json files and must be installed. I might remove this requirement later…
Installation
# 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
To-do
- [ ] Suppress command-not-found error message if script matches
- [ ] Options for handling namespace conflicts (e.g.,
test
)