Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
doc: update addAbortSignal webstream behavior
  • Loading branch information
ikeyan committed Mar 31, 2026
commit 79df0f747d627760e72c1496cc4c7a89251d6cc7
10 changes: 9 additions & 1 deletion doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -3476,6 +3476,11 @@ readable.getReader().read().then((result) => {
<!-- YAML
added: v15.4.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/62450
description: For web streams, `addAbortSignal()` now runs `cancel` steps on
`ReadableStream`, and aborts `controller.signal` and runs
`abort` steps on `WritableStream`.
- version:
- v19.7.0
- v18.16.0
Expand All @@ -3493,7 +3498,10 @@ control stream destruction using an `AbortController`.

Calling `abort` on the `AbortController` corresponding to the passed
`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`
on the stream, and `controller.error(new AbortError())` for webstreams.
on a Node.js stream. For web streams, it will error the stream with an
`AbortError`. For `ReadableStream`, it will then run the stream's cancel steps.
For `WritableStream`, it will abort `controller.signal` and then run the
stream's abort steps.

```js
const fs = require('node:fs');
Expand Down
Loading