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

x/compress/deps.ts>EventEmitter#eventNames

compress and uncompress for Deno
Go to Latest
method EventEmitter.prototype.eventNames
import { EventEmitter } from "https://deno.land/x/compress@v0.2.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>