Skip to content

Commit

Permalink
doc: clarify undocumented stream properties
Browse files Browse the repository at this point in the history
Fixes: #28592
Signed-off-by: James M Snell <[email protected]>

PR-URL: #36715
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
jasnell authored and danielleadams committed Jan 12, 2021
1 parent 242ce19 commit 214dbac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ object mode is not safe.
<!--type=misc-->

Both [`Writable`][] and [`Readable`][] streams will store data in an internal
buffer that can be retrieved using `writable.writableBuffer` or
`readable.readableBuffer`, respectively.
buffer.

The amount of data potentially buffered depends on the `highWaterMark` option
passed into the stream's constructor. For normal streams, the `highWaterMark`
Expand Down Expand Up @@ -120,6 +119,11 @@ writing data *to* the socket. Because data may be written to the socket at a
faster or slower rate than data is received, each side should
operate (and buffer) independently of the other.

The mechanics of the internal buffering are an internal implementation detail
and may be changed at any time. However, for certain advanced implementations,
the internal buffers can be retrieved using `writable.writableBuffer` or
`readable.readableBuffer`. Use of these undocumented properties is discouraged.

## API for stream consumers

<!--type=misc-->
Expand Down

0 comments on commit 214dbac

Please sign in to comment.