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
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#