Skip to main content
EventEmitter.removeAllListeners - node__events.d.ts - Node documentation
method EventEmitter.removeAllListeners

Usage in Deno

```typescript import { type EventEmitter } from "node:node__events.d.ts"; ```
EventEmitter.removeAllListeners(eventName?: Key<unknown, T>): this
Removes all listeners, or those of the specified `eventName`. It is bad practice to remove listeners added elsewhere in the code, particularly when the `EventEmitter` instance was created by some other component or module (e.g. sockets or file streams). Returns a reference to the `EventEmitter`, so that calls can be chained.

Parameters

optional
eventName: Key<unknown, T>

Return Type

this