Event Emitter Lab

0.0% Acceptance

In this lab, you'll work with Node.js built-in events module to create, emit, and handle custom events with the EventEmitter class. You'll explore how to use event-driven programming and manage multiple event listeners using the EventEmitter methods.

Before you begin the lab, make sure you have a basic understanding of event-driven programming in JavaScript, and familiarize yourself with Node.js built-in modules such as events.


  1. Create an instance of EventEmitter and import it in the main app file.
  2. Emit an event using eventEmitter.emit(eventName) method.
  3. Add an event listener using eventEmitter.on(eventName, listener) method.
  4. Remove an event listener using eventEmitter.off(eventName, listener) method.
  5. Log the total number of event listeners for a specific event.

Ready for the challenge? Let's dive in!