var events = require(‘events’);
var eventEmitter = new events.EventEmitter();
var ringBell = function ringBell()
console.log(‘ring ring ring’);
The above program is not written by me. Now am learning node js. I’am stuck with the topic of Events and EventEmitter. I’ve look up for a lot of videos and Tutorials, i coudn’t find anything that understand about this topic.
If you can help me with this topic please tell about the Events and also tell what you mean (eventEmitter.on(‘doorOpen’, ringBell);) “ON” in this program.