diff options
author | 2025-02-13 14:13:49 +0530 | |
---|---|---|
committer | 2025-02-13 14:13:49 +0530 | |
commit | 8a2e1006b3b272126332aa064f3ad95387129544 (patch) | |
tree | 944c80ac612a65980d94a54ba11b6c7102037ecf /.config/zsh/oh-my-zsh/plugins/node | |
parent | dcbb16d8b08ff5956abef5e6478b59df2e93ad35 (diff) | |
download | dotfiles-master.tar.gz dotfiles-master.tar.bz2 dotfiles-master.zip |
Diffstat (limited to '.config/zsh/oh-my-zsh/plugins/node')
-rw-r--r-- | .config/zsh/oh-my-zsh/plugins/node/README.md | 19 | ||||
-rw-r--r-- | .config/zsh/oh-my-zsh/plugins/node/node.plugin.zsh | 6 |
2 files changed, 25 insertions, 0 deletions
diff --git a/.config/zsh/oh-my-zsh/plugins/node/README.md b/.config/zsh/oh-my-zsh/plugins/node/README.md new file mode 100644 index 0000000..911b669 --- /dev/null +++ b/.config/zsh/oh-my-zsh/plugins/node/README.md @@ -0,0 +1,19 @@ +# node plugin + +This plugin adds `node-docs` function that opens specific section in [Node.js](https://nodejs.org) +documentation (depending on the installed version). + +To use it, add `node` to the plugins array of your zshrc file: + +```zsh +plugins=(... node) +``` + +## Usage + +```zsh +# Opens https://nodejs.org/docs/latest-v10.x/api/fs.html +$ node-docs fs +# Opens https://nodejs.org/docs/latest-v10.x/api/path.html +$ node-docs path +``` diff --git a/.config/zsh/oh-my-zsh/plugins/node/node.plugin.zsh b/.config/zsh/oh-my-zsh/plugins/node/node.plugin.zsh new file mode 100644 index 0000000..e196662 --- /dev/null +++ b/.config/zsh/oh-my-zsh/plugins/node/node.plugin.zsh @@ -0,0 +1,6 @@ +# Open the node api for your current version to the optional section. +# TODO: Make the section part easier to use. +function node-docs { + local section=${1:-all} + open_command "https://nodejs.org/docs/$(node --version)/api/$section.html" +} |