debug exposes a function; simply pass this function the name of your module, and it will return a decorated version of console.error for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. Example app.js: var debug = require('debug')('http') , http = require('http') , name = 'My App'; // fake app debug