Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 459f209

Browse filesBrowse files
GeorgeSapkinaddaleax
authored andcommitted
doc: Readable unpipe on Writable error event
PR-URL: #18080 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 1b32fc3 commit 459f209
Copy full SHA for 459f209

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+6Lines changed: 6 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ The `'unpipe'` event is emitted when the [`stream.unpipe()`][] method is called
323323
on a [Readable][] stream, removing this [Writable][] from its set of
324324
destinations.
325325

326+
This is also emitted in case this [Writable][] stream emits an error when a
327+
[Readable][] stream pipes into it.
328+
326329
```js
327330
const writer = getWritableStreamSomehow();
328331
const reader = getReadableStreamSomehow();
@@ -1496,6 +1499,9 @@ the callback and passing the error as the first argument. This will cause an
14961499
on how the stream is being used. Using the callback ensures consistent and
14971500
predictable handling of errors.
14981501

1502+
If a Readable stream pipes into a Writable stream when Writable emits an
1503+
error, the Readable stream will be unpiped.
1504+
14991505
```js
15001506
const { Writable } = require('stream');
15011507

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.