Quick Way of Inspecting a Node.js Module
Say you found a Node.js/NPM module that is poorly documented. Following is a quick way of inspecting all exported methods of a module:
> cd /tmp
> npm install badmodule
> node
Once you are in node REPL, type following commands:
> var badmodule = require('badmodule')
> badmodule.<TAB>
Basically if you require a module in Node REPL and then type name of the variable which you required module as, dot and hit "Tab", you will get a list of all exported methods.
Can be extremely handy and a better alternative to sifting through the code (which, granted you may still end up having to do if the module is that poorly documented).
Written by Irakli Nadareishvili
Related protips
2 Responses

This is a really good suggestion! I'd like to make an additional suggestion: open an issue on the module's Github page about the lack of documentation.
over 1 year ago
·

@faceleg ha, touché! :-)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Tips
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#