Node.js, Turn debugging on for specific modules

Sometimes when working on a Node.js app, it's helpful to turn debugging on for particular modules. To do so, you can simply set an environment variable NODE_DEBUG when you start your app to flag which modules should output their debug messages.

Here's how to enable debugging for, say, the http, cluster, and socket.io modules:

$> NODE_DEBUG={http,cluster,socket.io} node app

Tags: