EventEmitter is Node's class implementing the observer pattern: an object emits named events with emit and listeners receive them via on or once. Many modules (streams, the HTTP server) inherit from it. An error event with no listener crashes the program.
Example
const e = new EventEmitter();
e.on('pret', () => console.log('ok'));
e.emit('pret');