Skip to content

fix(ext/node): align node stream destroy named export#33573

Open
ktKongTong wants to merge 1 commit intodenoland:mainfrom
ktKongTong:fix-node-steam-named-export-destroy
Open

fix(ext/node): align node stream destroy named export#33573
ktKongTong wants to merge 1 commit intodenoland:mainfrom
ktKongTong:fix-node-steam-named-export-destroy

Conversation

@ktKongTong
Copy link
Copy Markdown

align node:stream destroy named export

import { destroy } from "node:stream";

console.log(typeof destroy);

Expect Output: function

Actual Output: Uncaught SyntaxError: The requested module 'node:stream' does not provide an export named 'destroy'

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 27, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified against Node's lib/stream.js — Node's public API is Stream.destroy = destroyer (the implementation is named destroyer internally, but the export surface is destroy). So import { destroy } from 'node:stream' is the correct Node form, and destroyer was a Deno-specific divergence. Renaming the named export to destroy matches Node and keeps the existing Stream.destroy = destroyer assignment on line 126 consistent with the new export.

One observation inline: dropping the destroyer export name entirely is technically a breaking change for any Deno-specific code that imported destroyer from node:stream — though that name never existed in Node, so realistically very few users would have written that. Searched tests/, ext/ and found zero internal usages, so internally clean.

No CI signal yet (the PR is from an external contributor — only lint title and CLA have run; full CI needs a maintainer to authorize), but the change is so small that visual review covers it.

Comment thread ext/node/polyfills/stream.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants