Created
December 19, 2017 19:41
-
-
Save evanlucas/6767876c52aa5bd3a072f931566c7876 to your computer and use it in GitHub Desktop.
Show every event that is emitted
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const EE = require('events') | |
const emit = EE.prototype.emit | |
EE.prototype.emit = function(name, ...args) { | |
if (this.constructor) { | |
console.log('EMIT', this.constructor.name, name) | |
} else { | |
console.log('EMIT', '<unknown>', name) | |
} | |
return emit.call(this, name, ...args) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of using
node index.js
, now, run withnode -r ./ee-debug.js index.js