var EventEmitter = require('events').EventEmitter; var e = new EventEmitter(); e.on('something', function() { throw new Error('anonymous function crash'); }); e.on('something_else', function foo() { throw new Error('named function crash'); }); e.emit(process.argv[2]);