summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Hodges <betawaffle@gmail.com>2011-05-28 11:20:48 -0400
committerAndrew Hodges <betawaffle@gmail.com>2011-05-28 11:20:48 -0400
commitd72b9c5ec5d55765998bb301b3425fbe84012c1f (patch)
treef3150070669660a71cf8434ef51d62b418819bad
parentbefb02e3da0573fa788114e1c18c70b75f787f1f (diff)
downloadzsh-d72b9c5ec5d55765998bb301b3425fbe84012c1f.tar.gz
zsh-d72b9c5ec5d55765998bb301b3425fbe84012c1f.tar.bz2
zsh-d72b9c5ec5d55765998bb301b3425fbe84012c1f.zip
Node.js Helpers
Add helper function to open node api in browser. Add binaries installed via npm to path. Tell node where to find things (what things?).
-rw-r--r--plugins/node/node.plugin.zsh8
-rw-r--r--plugins/npm/npm.plugin.zsh2
2 files changed, 10 insertions, 0 deletions
diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh
new file mode 100644
index 000000000..18f35333c
--- /dev/null
+++ b/plugins/node/node.plugin.zsh
@@ -0,0 +1,8 @@
+# This works if you installed node via homebrew.
+export NODE_PATH="/usr/local/lib/node"
+
+# Open the node api for your current version to the optional section.
+# TODO: Make the section part easier to use.
+function node-api {
+ open "http://nodejs.org/docs/$(node --version)/api/all.html#$1"
+}
diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
new file mode 100644
index 000000000..0b0a30e11
--- /dev/null
+++ b/plugins/npm/npm.plugin.zsh
@@ -0,0 +1,2 @@
+# TODO: Don't do this in such a weird way.
+export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/share/npm/bin:&|'`