The NodeEventTarget object implements a modified subset of the
EventEmitter API that allows it to closely emulate an EventEmitter in
certain situations. A NodeEventTarget is not an instance of EventEmitter
and cannot be used in place of an EventEmitter in most cases.
- Unlike
EventEmitter, any givenlistenercan be registered at most once per eventtype. Attempts to register alistenermultiple times are ignored. - The
NodeEventTargetdoes not emulate the fullEventEmitterAPI. Specifically theprependListener(),prependOnceListener(),rawListeners(),setMaxListeners(),getMaxListeners(), anderrorMonitorAPIs are not emulated. The'newListener'and'removeListener'events will also not be emitted. - The
NodeEventTargetdoes not implement any special default behavior for events with type'error'. - The
NodeEventTargetsupportsEventListenerobjects as well as functions as handlers for all event types.
