add conditions to open module specific node documentation

This commit is contained in:
Sachin George Thomas 2016-10-25 19:55:46 +05:30
commit d3939a5f7d

View file

@ -1,5 +1,9 @@
# Open the node api for your current version to the optional section.
# TODO: Make the section part easier to use.
function node-docs {
open_command "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1"
if [ $# -eq 0 ]; then
open_command "http://nodejs.org/docs/$(node --version)/api/all.html"
else
open_command "http://nodejs.org/docs/$(node --version)/api/$1.html"
fi
}