Skip to content

Instantly share code, notes, and snippets.

@jwerle
Created May 14, 2013 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwerle/5579308 to your computer and use it in GitHub Desktop.
Save jwerle/5579308 to your computer and use it in GitHub Desktop.
overload .emit()
var http, server, emit
http = require('http')
server = http.createServer(function () { console.log('ok') })
emit = emit = server.emit
server.emit = function () {
// log it out
console.log('[server]:', arguments[0])
// apply old emit
emit.apply(this, arguments);
};
void server.listen(4000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment