EventEmitter для излучения пользовательского события
const EventEmitter = require('events');
const eventEmitter = new EventEmitter ();
eventEmitter.on('greet', () => {
console.log('Hello world!');
});
eventEmitter.emit('greet');
MD YASIN MIAH 4049