Created
February 4, 2013 18:48
-
-
Save larzconwell/4708667 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open node documentation in your browser. | |
# Usage: node-docs [module=all] [version=$(node --version)] | |
function node-docs() { | |
local version="$(node --version)" | |
local module="all" | |
local url="http://nodejs.org/docs/" | |
if [[ "$2" != "" ]]; then | |
version="v$2" | |
fi | |
if [[ "$1" != "" ]]; then | |
module="$1" | |
fi | |
url+="$version/api/$module.html" | |
if test -f "$(which xdg-open)"; then | |
nohup xdg-open "$url" >> /dev/null 2>&1 | |
else | |
nohup open "$url" >> /dev/null 2>&1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment