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.prototype.once
import { default } from "https://deno.land/std@0.76.0/node/events.ts";

Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

Parameters

eventName: string | symbol
listener: GenericFunction