NodeEventTarget
The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API.
Since
v14.5.0
Functions
Node.js-specific extension to the EventTarget class that emulates the equivalent EventEmitter API. The only difference between addListener() and addEventListener() is that addListener() will return a reference to the EventTarget.
Node.js-specific extension to the EventTarget class that returns an array of event type names for which event listeners are registered.
Node.js-specific extension to the EventTarget class that returns the number of max event listeners.
Node.js-specific extension to the EventTarget class that returns the number of event listeners registered for the type.
Node.js-specific extension to the EventTarget class. If type is specified, removes all registered listeners for type, otherwise removes all registered listeners.
Node.js-specific extension to the EventTarget class that removes the listener for the given type. The only difference between removeListener() and removeEventListener() is that removeListener() will return a reference to the EventTarget.
Node.js-specific extension to the EventTarget class that sets the number of max event listeners as n.