node-doc 378 B

12345678910111213141516171819
  1. #
  2. # Opens the Node.js online API documentation in the default browser.
  3. #
  4. # Authors:
  5. # Sorin Ionescu <sorin.ionescu@gmail.com>
  6. #
  7. # function node-doc {
  8. if [[ -z "$BROWSER" ]]; then
  9. print "$0: no web browser defined" >&2
  10. return 1
  11. fi
  12. # TODO: Make the sections easier to use.
  13. "$BROWSER" "https://nodejs.org/docs/${$(node --version 2> /dev/null)/%-*}/api/all.html#${1}"
  14. # }