Create an EventEmitter.
Emits an event, triggering all associated listeners in registration order.
Always returns a promise: await emit(...) waits for every (sync and async) listener to
settle. A synchronous caller may fire-and-forget, but then it opts out of awaiting async
listeners and of handling their errors.
Listeners are isolated: one that throws or rejects does not prevent the others from
running. If any listener fails, emit rejects after all have run — with the single
error, or an AggregateError when several failed.
The event name or an instance of Event.
Optionalargs: any
Additional arguments to pass to the listeners.
Removes an event listener for the given event type.
The event name or type.
The callback to remove.
Registers an event listener for the given event type.
The event name or type.
The callback to invoke when the event is emitted.
Registers a one-shot event listener that is removed after its first invocation.
The event name or type.
The callback to invoke once when the event is emitted.
Staticcreate
Class representing an EventEmitter.