What is EventEmitter in Node.js?

All objects that emit events are instances of the EventEmitter class. 

These objects expose an eventEmitter.on() function that allows one or more functions to be attached to named events emitted by the object.

When the EventEmitter object emits an event, all of the functions attached to that specific event are called synchronously.

Image for post

Comments

Popular posts from this blog

Which node logger did you use in your project?

What are clusters and worker threads, and when would you use them?