Skip to content

Commit

Permalink
doc: document missing options of events.on
Browse files Browse the repository at this point in the history
  • Loading branch information
atlowChemi committed Mar 17, 2024
1 parent d50efc4 commit ac60b76
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/api/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -1661,12 +1661,31 @@ console.log(listenerCount(myEmitter, 'event'));
added:
- v13.6.0
- v12.16.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/52080
description: Support `highWaterMark` and `lowWaterMark` options,
For consistency. Old options are still supported.
- version:
- v20.0.0
pr-url: https://github.com/nodejs/node/pull/41276
description: The `close`, `highWatermark`, and `lowWatermark`
options are supported now.
-->

* `emitter` {EventEmitter}
* `eventName` {string|symbol} The name of the event being listened for
* `options` {Object}
* `signal` {AbortSignal} Can be used to cancel awaiting events.
* `close` - {string\[]} Names of events that will end the iteration.
* `highWaterMark` - {integer} **Default:** `Number.MAX_SAFE_INTEGER`
The high watermark. The emitter is paused every time the size of events
being buffered is higher than it. Supported only on emitters implementing
`pause()` and `resume()` methods.
* `lowWaterMark` - {integer} **Default:** `1`
The low watermark. The emitter is resumed every time the size of events
being buffered is lower than it. Supported only on emitters implementing
`pause()` and `resume()` methods.
* Returns: {AsyncIterator} that iterates `eventName` events emitted by the `emitter`

```mjs
Expand Down

0 comments on commit ac60b76

Please sign in to comment.