Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/denjucks/src/deps/path/std/node/events.ts>on

Deno templating engine
Latest
function on
import { on } from "https://deno.land/x/denjucks@1.1.1/src/deps/path/std/node/events.ts";

Returns an AsyncIterator that iterates eventName events. It will throw if the EventEmitter emits 'error'. It removes all listeners when exiting the loop. The value returned by each iteration is an array composed of the emitted event arguments.

Parameters

emitter: EventEmitter
event: string | symbol

Returns

AsyncInterable