October, 2011

Nodejs EventEmitter Example With Custom Events

published: 2011-10-04

A good example of an event emitter needs three things:

  • A thing that emits events
  • A thing that listens to, and handles, those events
  • Something that drives the two, causing events to be emitted.

Using node v0.4.11-pre, here is a small example illustrating custom event handling using EventEmitter.