Skip to content

Commit d0c364a

Browse files
atlowCheminodejs-github-bot
authored andcommitted
doc: document missing options of events.on
Fixes: #52078 Refs: #41276 PR-URL: #52080 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent d619aab commit d0c364a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

doc/api/events.md

+19
Original file line numberDiff line numberDiff line change
@@ -1661,12 +1661,31 @@ console.log(listenerCount(myEmitter, 'event'));
16611661
added:
16621662
- v13.6.0
16631663
- v12.16.0
1664+
changes:
1665+
- version: REPLACEME
1666+
pr-url: https://github.com/nodejs/node/pull/52080
1667+
description: Support `highWaterMark` and `lowWaterMark` options,
1668+
For consistency. Old options are still supported.
1669+
- version:
1670+
- v20.0.0
1671+
pr-url: https://github.com/nodejs/node/pull/41276
1672+
description: The `close`, `highWatermark`, and `lowWatermark`
1673+
options are supported now.
16641674
-->
16651675

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

16721691
```mjs

0 commit comments

Comments
 (0)