Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/ext/node/polyfills/events.ts

A modern runtime for JavaScript and TypeScript.
Latest
import * as deno from "https://deno.land/x/deno@v2.0.4/ext/node/polyfills/events.ts";

Classes

The EventEmitter class is defined and exposed by the events module:

The EventEmitter class is defined and exposed by the events module:

Functions

Returns a copy of the array of listeners for the event named eventName.

f
listenerCount
deprecated

A class method that returns the number of listeners for the given eventNameregistered on the given emitter.

Creates a Promise that is fulfilled when the EventEmitter emits the given event or that is rejected if the EventEmitter emits 'error' while waiting. The Promise will resolve with an array of all the arguments emitted to the given event.

n {number} A non-negative number. The maximum number of listeners per EventTarget event. ...eventsTargets {EventTarget[]|EventEmitter[]} Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, n is set as the default max for all newly created {EventTarget} and {EventEmitter} objects.