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

Comments

Popular posts from this blog

Project euler 169 found clue

Floyd-Warshall's algorithm