Skip to content

Commit c55a3be

Browse files
atlowChemimarco-ippolito
authored andcommittedMay 3, 2024
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 7bfb0b4 commit c55a3be

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
@@ -1657,12 +1657,31 @@ console.log(listenerCount(myEmitter, 'event'));
16571657
added:
16581658
- v13.6.0
16591659
- v12.16.0
1660+
changes:
1661+
- version: REPLACEME
1662+
pr-url: https://github.com/nodejs/node/pull/52080
1663+
description: Support `highWaterMark` and `lowWaterMark` options,
1664+
For consistency. Old options are still supported.
1665+
- version:
1666+
- v20.0.0
1667+
pr-url: https://github.com/nodejs/node/pull/41276
1668+
description: The `close`, `highWatermark`, and `lowWatermark`
1669+
options are supported now.
16601670
-->
16611671

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

16681687
```mjs

0 commit comments

Comments
 (0)