Skip to content

Commit 72ee03b

Browse files
YspritanHyzygyclaude
authored andcommitted
doc: document stream.isDestroyed()
`stream.isDestroyed()` has been exported since v19.9.0 but was never documented, while its siblings `isErrored()`, `isReadable()` and `isWritable()` all have entries in `doc/api/stream.md`. Unlike those, `isDestroyed()` rejects Web streams: it returns `null` for anything that is not a Node.js stream. The accepted types are therefore documented as `Readable|Writable|Duplex` rather than also listing `ReadableStream`/`WritableStream`. Refs: #45671 Co-Authored-By: Claude Opus 5 <[email protected]> Signed-off-by: YspritanHyzygy <[email protected]> PR-URL: #64789 Reviewed-By: Aviv Keller <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 1fefdda commit 72ee03b

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

doc/api/stream.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,6 +3110,19 @@ console.log(res); // prints 'HELLOWORLD'
31103110
For convenience, the [`readable.compose(stream)`][] method is available on
31113111
{Readable} and {Duplex} streams as a wrapper for this function.
31123112

3113+
### `stream.isDestroyed(stream)`
3114+
3115+
<!-- YAML
3116+
added:
3117+
- v19.9.0
3118+
- v18.17.0
3119+
-->
3120+
3121+
* `stream` {Readable|Writable|Duplex}
3122+
* Returns: {boolean|null} - Only returns `null` if `stream` is not a valid `Readable`, `Writable` or `Duplex`.
3123+
3124+
Returns whether the stream has been destroyed.
3125+
31133126
### `stream.isErrored(stream)`
31143127

31153128
<!-- YAML

0 commit comments

Comments
 (0)