Skip to content

Commit 3b693ac

Browse files
committed
doc: document missing options of events.on
Fixes: #52078 Refs: #41276
1 parent 639c096 commit 3b693ac

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/api/events.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,12 +1661,24 @@ console.log(listenerCount(myEmitter, 'event'));
16611661
added:
16621662
- v13.6.0
16631663
- v12.16.0
1664+
changes:
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.
16641670
-->
16651671

16661672
* `emitter` {EventEmitter}
16671673
* `eventName` {string|symbol} The name of the event being listened for
16681674
* `options` {Object}
16691675
* `signal` {AbortSignal} Can be used to cancel awaiting events.
1676+
* `close` - {string\[]} Can be used to set event names that will end
1677+
the iteration.
1678+
* `highWatermark` - {integer} **Default:** `Number.MAX_SAFE_INTEGER`
1679+
Sets the `highWaterMark` used for the stream.
1680+
* `lowWatermark` - {integer} **Default:** `1`
1681+
Sets the `lowWaterMark` used for the stream.
16701682
* Returns: {AsyncIterator} that iterates `eventName` events emitted by the `emitter`
16711683

16721684
```mjs

0 commit comments

Comments
 (0)