Stop 02 · Node.js FundamentalsTopics · 16/18

Event Emitter

Part of the Backend Developer Roadmap

In short

Node's built-in pattern for building objects that emit named events other code can listen for — the mechanism underlying HTTP servers, streams, and much of Node's core API.

How to learn this

  1. 1Build a simple custom class extending `EventEmitter` that emits a custom event.
  2. 2Learn `.on()`, `.once()` and `.emit()`.
  3. 3Recognize that Node's `http.Server` and streams are themselves EventEmitters.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge