When I download a third party module for example:
npm install twitter
How can I tell what functions/methods are available when I create an object. Example:
var twitter = require('twitter');
This also applies with the “hello world webserver” you commonly see with node.js
var http = require('http');
var server = http.createServer(function(req, res) {
res.writeHead(200);
res.end('Hello Http');
});
server.listen(8080);
Is there some command I can run on the http module to get a list of functions/methods like .createServer()
I could dig around for online documentation about the specific module but was hoping there was a command line way of simply retrieving a list of available functions/methods
Btw… in node.js what do they call them? Functions or Methods?
Did you try?
To see what is in object there is also beautiful module called “util”:
util.inspect returns string representation of object.