Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command line documentation viewer for node js modules

Is there a way to display the documentation of installed NodeJS packages in a console window (as a command line tool)? Often - in case of editing on a server - it is easier to view the docs of some specific stuff right in the command window, then to start a browser.

Such as npm docs fs or npm docs express would be perfect, but these try to start a browser and display documentation there instead of displaying README.md directly in the window.

Something similar to Perl's perldoc would be a perfect solution.

like image 432
FERcsI Avatar asked Nov 09 '22 04:11

FERcsI


1 Answers

Here's what I do when I'm in a hurry:

# nodedoc
# USAGE: nodedoc <name of module>
# e.g. nodedoc http

curl https://raw.githubusercontent.com/nodejs/node/master/doc/api/$1.md | pandoc --from markdown --to plain | less
like image 171
HNL Avatar answered Nov 14 '22 20:11

HNL