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

x/velo/deps.ts>EventEmitter#eventNames

A high-performance caching library for Deno. Supports LRU, LFU, ARC, and TinyLFU.
Latest
method EventEmitter.prototype.eventNames
import { EventEmitter } from "https://deno.land/x/velo@1.0.0/deps.ts";

Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

const EventEmitter = require('events');
const myEE = new EventEmitter();
myEE.on('foo', () => {});
myEE.on('bar', () => {});

const sym = Symbol('symbol');
myEE.on(sym, () => {});

console.log(myEE.eventNames());
// Prints: [ 'foo', 'bar', Symbol(symbol) ]

Returns

Array<string | symbol>