Nearby lessons

18 of 21

🎉 Node.js – Events Module

📌 What is Events Module?

What is the Events Module?

The events module in Node.js allows us to work with events. An event is an action that occurs in our application that we can respond to. Node.js is perfect for event-driven applications.

Using the events module, we can create custom events and respond to them in a non-blocking manner.

📌 Examples of Events

  • On Click
  • On Double Click
  • On Mouse Over
  • On Mouse Out
  • On Submit
  • On Change
  • On Reset
  • Key Press

🔹 Example 1: Basic Event Handling – Separate Handler Function

Example03
Loading editor…

🔹 Example 1: Basic Event Handling – Inline Function

Example04
Loading editor…

🔹 Example 2: Passing Parameters in EventEmitter

Example05
Loading editor…

🔹 Example 3: Multiple Event Handlers

Example06
Loading editor…

🧠 Test Your Knowledge

4 Questions
Progress: 0 / 4