@pjshell/zsh

0.0.3 • Public • Published

pjshell - package.json script shell

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 👍

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)

Package Sidebar

Install

npm i @pjshell/zsh

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

2.87 kB

Total Files

3

Last publish

Collaborators

  • teddy-error