var events = require('events'), util = require('util'); var Custom = function() { title:"Custom Object"; } //Custom.prototype = new events.Emitter; util.inherits(Custom, events.EventEmitter); var custom = new Custom(); custom.on('schawawa', function(arg) { console.log('react on schawawa with data: '+arg); }); setTimeout(function() { custom.emit('schawawa', '\\0000'); }, 2000);