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

Usage in Deno

```typescript import { type EventEmitter } from "node:node__events.d.ts"; ```
EventEmitter.setMaxListeners(n: number): this
By default `EventEmitter`s will print a warning if more than `10` listeners are added for a particular event. This is a useful default that helps finding memory leaks. The `emitter.setMaxListeners()` method allows the limit to be modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. Returns a reference to the `EventEmitter`, so that calls can be chained.

Parameters

n: number

Return Type

this