Gunzip.eventNames method | Node.js zlib module | Bun
BuildDocsReferenceGuidesBlogDiscord/
node:zlib/
Gunzip/
eventNamesMeventNames
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
node:zlib/
Gunzip/
eventNamesMeventNames
method
zlib.Gunzip.eventNames {});
myEE.on('bar', () => {});
const sym = Symbol('symbol');
myEE.on(sym, () => {});
console.log(myEE.eventNames());
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
```" data-algolia-static="false" data-algolia-merged="false" data-type="Method">
eventNames(): string | symbol[];
Returns an array listing the events for which the emitter has registered listeners.
import { EventEmitter } from 'node: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) ]
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →