https://github.com/joyent/node/blob/master/lib/events.js#L142-147
It throws a newListener event with a name and a function.
Next, instead of changing events.js, break through the prototype. After you need an EventEmitter, you can disable it at run time. This is bad practice in general, especially for something as important as EventEmitter, but it is great for debugging your own program.
(function(){ var old = EventEmitter.prototype.emit; EventEmitter.prototype.emit = ... )();
Next, write down the other handlers:
console.log(emitter.listeners('eventName'));
source share