EventEmitter is a class in NodeJS that helps to listen or fire events in your application. You can also keep track of events in you application.
Let's start with a simple eventEmitter example. First of all we need to add Event Object in our project
const events = require('events');
var eventEmitter = new events.EventEmitter();