Thursday, August 28, 2014

event emiter in nodejs

var custom = new process.EventEmitter();

custom.on('hello', function(){ console.log('event generated')});

custom.emit('hello');



======================
"event generated" log will be written in console

No comments:

Post a Comment