Skip to content

doc: document stream.isDestroyed() - #64789

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
YspritanHyzygy:doc-stream-isdestroyed
Aug 2, 2026
Merged

doc: document stream.isDestroyed()#64789
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
YspritanHyzygy:doc-stream-isdestroyed

Conversation

@YspritanHyzygy

@YspritanHyzygyYspritanHyzygy commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

stream.isDestroyed() has been exported from lib/stream.js since v19.9.0 (#45671) but has never been documented, while the sibling helpers exported alongside it — isErrored(), isReadable() and isWritable() — all have entries.

added: was determined by checking lib/stream.js at each release tag rather than from the landing date, since the commit predates the releases that carry it:

tagreleasedStream.isDestroyed present
v19.8.12023-03-15no
v19.9.02023-04-05yes
v18.16.02023-04-10no
v18.17.02023-07-10yes (backport)

v20.0.0 inherited it from main rather than adding it, so it is not listed — matching how isErrored() lists only v17.3.0 and its v16.14.0 backport.

One difference is worth calling out, because it affects the documented types: unlike isErrored() and isReadable(), isDestroyed() bails out on anything that is not a Node.js stream (if (!isNodeStream(stream)) return null), so Web streams are not accepted:

isDestroyed(newReadable({read(){}}));// falseisDestroyed(destroyedReadable);// trueisDestroyed(newReadableStream());// nullisDestroyed({});// null

The entry therefore lists Readable|Writable|Duplex and reuses the {boolean|null} wording already established by isReadable() and isWritable().

make lint-md and make doc-only both pass locally.

@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem. labels Jul 27, 2026
`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: nodejs#45671
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: YspritanHyzygy <yspritan@gmail.com>
@YspritanHyzygy
YspritanHyzygyforce-pushed the doc-stream-isdestroyed branch from 6aca481 to 156cbceCompareJuly 27, 2026 18:28
@YspritanHyzygy

Copy link
Copy Markdown
ContributorAuthor

Corrected the added: metadata after your approval, sorry for the churn. stream.isDestroyed() first shipped in v19.9.0, not v20.0.0 — v19.8.1 does not have the export and v19.9.0 does, and it was backported to v18.17.0 (v18.16.0 does not have it). v20.0.0 inherited it from main rather than adding it. The PR description now has the per-tag check.

Only the YAML block changed; the entry text is unchanged.

@YspritanHyzygy

Copy link
Copy Markdown
ContributorAuthor

test-linux (ubuntu-24.04) failed with The hosted runner lost communication with the server, which isn't a test failure — no test reports a failure anywhere in the log, and test-linux (ubuntu-24.04-arm) passed on the same commit. Could someone re-run that job? I don't have permission to.

@daeyeondaeyeon added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 28, 2026
@jasnelljasnell added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 2, 2026
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 2, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 4b8cee0 into nodejs:mainAug 2, 2026
23 of 24 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 4b8cee0

aduh95 pushed a commit that referenced this pull request Aug 3, 2026
`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 <noreply@anthropic.com>
Signed-off-by: YspritanHyzygy <yspritan@gmail.com>
PR-URL: #64789
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 4, 2026
`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 <noreply@anthropic.com>
Signed-off-by: YspritanHyzygy <yspritan@gmail.com>
PR-URL: #64789
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 4, 2026
`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 <noreply@anthropic.com>
Signed-off-by: YspritanHyzygy <yspritan@gmail.com>
PR-URL: #64789
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 5, 2026
`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 <noreply@anthropic.com>
Signed-off-by: YspritanHyzygy <yspritan@gmail.com>
PR-URL: #64789
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.docIssues and PRs related to the documentations.streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@YspritanHyzygy@nodejs-github-bot@jasnell@lpinca@daeyeon@avivkeller@bjohansebas