Take the 2-minute tour ×

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.end('Hello Http');

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?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

Did you try?

var http = require('http');

To see what is in object there is also beautiful module called "util":

var util = require('util'); 

util.inspect returns string representation of object.

share|improve this answer
add comment

At the node prompt, just type:


That will dump the function and data members of the module to the console.

The function and method terms are largely interchangeable in node.js.

share|improve this answer
Great thank you ver much! –  nwkeeley Dec 10 '12 at 1:48
add comment

Your Answer


