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]>
  • Loading branch information
jasnell committed Jan 2, 2021
1 parent 51b4367 commit dc2e838
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 dc2e838

Please sign in to comment.