b53fbc36c15d5d2f65ec1779cec9e05b533337b6

Author
Pooya Parsa <pyapar@gmail.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

plugin: npx (#6152)

Diff

 1diff --git a/plugins/npx/README.md b/plugins/npx/README.md
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..2c94e4515825c04787c16badf9abd4834896777b
 4--- /dev/null
 5+++ b/plugins/npx/README.md
 6@@ -0,0 +1,17 @@
 7+# NPX Plugin
 8+> npx(1) -- execute npm package binaries. ([more info](https://github.com/zkat/npx))
 9+
10+This plugin automatically registers npx command-not-found handler if `npx` exists in your `$PATH`.
11+
12+## Setup
13+
14+- Add plugin to `~/.zshrc`
15+
16+```bash
17+plugins=(.... npx)
18+```
19+
20+- Globally install npx binary (you need node.js installed too!)
21+```bash
22+sudo npm install -g npx
23+```
24diff --git a/plugins/npx/npx.plugin.zsh b/plugins/npx/npx.plugin.zsh
25new file mode 100644
26index 0000000000000000000000000000000000000000..32bb67377a0db4c22832b24e12ed46afbb0eabc0
27--- /dev/null
28+++ b/plugins/npx/npx.plugin.zsh
29@@ -0,0 +1,7 @@
30+# NPX Plugin
31+# https://www.npmjs.com/package/npx
32+# Maintainer: Pooya Parsa <pooya@pi0.ir>
33+
34+(( $+commands[npx] )) && {
35+ source <(npx --shell-auto-fallback zsh)
36+}