Node.js is built around an event-driven architecture
And one of the core modules behind it is: EventEmitter.
It allows different parts of your application to:
✔ Emit events
✔ Listen for events
✔ React asynchronously
This is how Node.js handles:
• Streams
• HTTP requests
My Notes :
1. EventEmitter is an inbuilt class provided by Nodejs.
2. To use class object we type :
const emitter = new EventEmitter();
& user emitter object which holds methods and properties to use.
3. From them , we explore on and emit prototype.
4. Multiple events can be trigger by same emitter and same emitter can trigger multiple same
event. Explore by example.
5. Know what is eventlistener & eventhandlers
------------
5. Explore setMaxListeners(), once() --OPTIONAL
Download
0 formats
No download links available.
How Events Work in Node.js | EventEmitter in Node.js Explained | NatokHD