I am starting a series on node js. Actually I’m not super skilled with node js. So I thought let’s start from zero again and help others with me to learn about it. I saw the ‘the net ninja’ tutorials and took the syllabus from there and make a fusion of my own. I want to help you with my journey, let’s ride together into node js for 30 days…
Day 9 — Mastering EventEmitter— Learning Node JS In 30 Days [Mini series]
A full series to learn the basics easily of node js
Events (Core module of node js) — https://nodejs.org/api/events.html
First we need to require the events
Now we can do something for clicking any element.
This event
module will help us to use click and different events. We can now create custom events also!
For using the custom event first we’ll const myEmitter = new events()
and get new events on myEmitter
Second step is making a new custom event which is called customEvent
in this occassion
Then finally we need make this event happens using myEmitter.emit
Final Result
So do you understand a bit of EventEmitter right now ?
Originally it published on nerdjfpb blog and graphical version on instagram. you can connect with me in twitter, linkedin or instagram