I have recently started using node.js. One thing I do not understand is how to find out what attributes, i.e. fields/properties, a class or object from a module has, for example the url or http module.
I have looked at the official documentation and there is only information regarding the class functions, and not the attributes of the class.
So what I am asking is, is there a way to find out all of the attributes for an object or class from a specific module?
I come from a Java background and as you all know the documentation for the different classes and libraries is very detailed - you can find out about every field and method in each class.
if you require a node module you will get an object back. Could be a function thou (which is an object again). As what you get is an object you can use the standard javascript methods to get to the keys.
var module = require("module_to_require");
for (var key in Object.keys(module)) {
console.log(key);
}