Skip to main content

Module events

Module events 

Source
Expand description

Node events module: EventEmitter. The emitter is an object tagged @@native = "EventEmitter" with hidden @@on/@@once maps (event name → listener array). emit collects listeners, releases the host borrow, then invokes each so callbacks can re-enter the host.

Constants§

METHODS
The EventEmitter method names, exposed so EventEmitter.prototype can be enumerated / copied (express does mixin(app, EventEmitter.prototype) to make its app function an emitter).
STATIC_METHODS
Static functions on the events module namespace. EventEmitter (the self-ref ctor) and EventEmitterAsyncResource are handled by the parent; on (async iterator) is deferred (see module docs / final report).

Functions§

instance_call
new_emitter
Construct a fresh EventEmitter.
static_call
Dispatch a static events.<method>(...). Returns None for names this module does not own (e.g. EventEmitter) so the parent’s specific arm wins.