Skip to content

Commit ae5d47d

Browse files
benjamingrmarco-ippolito
authored andcommittedJun 17, 2024
doc: watermark string behavior
Documents that we calculate the highWaterMark value of streams operating on strings using the number of UTF-16 code units. Fixes: #52818 PR-URL: #52842 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 6001b16 commit ae5d47d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎doc/api/stream.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,9 @@ buffer.
317317
The amount of data potentially buffered depends on the `highWaterMark` option
318318
passed into the stream's constructor. For normal streams, the `highWaterMark`
319319
option specifies a [total number of bytes][hwm-gotcha]. For streams operating
320-
in object mode, the `highWaterMark` specifies a total number of objects.
320+
in object mode, the `highWaterMark` specifies a total number of objects. For
321+
streams operating on (but not decoding) strings, the `highWaterMark` specifies
322+
a total number of UTF-16 code units.
321323

322324
Data is buffered in `Readable` streams when the implementation calls
323325
[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not

0 commit comments

Comments
 (0)
Please sign in to comment.