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

std/node/events.ts>default.once

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
method default.once
import { default } from "https://deno.land/std@0.82.0/node/events.ts";

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

Parameters

emitter: EventEmitter | EventTarget
name: string

Returns

Promise<any[]>