From b53fbc36c15d5d2f65ec1779cec9e05b533337b6 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 6 Nov 2017 18:18:56 +0330 Subject: plugin: npx (#6152) --- plugins/npx/README.md | 17 +++++++++++++++++ plugins/npx/npx.plugin.zsh | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 plugins/npx/README.md create mode 100644 plugins/npx/npx.plugin.zsh (limited to 'plugins/npx') diff --git a/plugins/npx/README.md b/plugins/npx/README.md new file mode 100644 index 000000000..2c94e4515 --- /dev/null +++ b/plugins/npx/README.md @@ -0,0 +1,17 @@ +# NPX Plugin +> npx(1) -- execute npm package binaries. ([more info](https://github.com/zkat/npx)) + +This plugin automatically registers npx command-not-found handler if `npx` exists in your `$PATH`. + +## Setup + +- Add plugin to `~/.zshrc` + +```bash +plugins=(.... npx) +``` + +- Globally install npx binary (you need node.js installed too!) +```bash +sudo npm install -g npx +``` \ No newline at end of file diff --git a/plugins/npx/npx.plugin.zsh b/plugins/npx/npx.plugin.zsh new file mode 100644 index 000000000..32bb67377 --- /dev/null +++ b/plugins/npx/npx.plugin.zsh @@ -0,0 +1,7 @@ +# NPX Plugin +# https://www.npmjs.com/package/npx +# Maintainer: Pooya Parsa + +(( $+commands[npx] )) && { + source <(npx --shell-auto-fallback zsh) +} -- cgit v1.2.3-70-g09d2 From d6aeaad83d73855776f7c937ef51428523295352 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sat, 26 May 2018 21:09:32 +0430 Subject: [plugin] update NPX docs (#6849) --- plugins/npx/README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'plugins/npx') diff --git a/plugins/npx/README.md b/plugins/npx/README.md index 2c94e4515..1c052930b 100644 --- a/plugins/npx/README.md +++ b/plugins/npx/README.md @@ -11,7 +11,21 @@ This plugin automatically registers npx command-not-found handler if `npx` exist plugins=(.... npx) ``` -- Globally install npx binary (you need node.js installed too!) +- Globally install npx binary (npx will be auto installed with recent versions of Node.js) ```bash sudo npm install -g npx -``` \ No newline at end of file +``` + +## Note + +The shell auto-fallback doesn't auto-install plain packages. In order to get it to install something, you need to add `@`: + +``` +➜ jasmine@latest # or just `jasmine@` +npx: installed 13 in 1.896s +Randomized with seed 54385 +Started +``` + +It does it this way so folks using the fallback don't accidentally try to install regular typoes. + -- cgit v1.2.3-70-g09d2