Skip to content

TODO: stream.Readable stdio and TODO: stream.Writable stdio (node compat) #25498

@lgarron

Description

@lgarron

What is the problem this feature would solve?

Passing a Readable (more generally a Readable) to the stdin of a node subprocess is useful, but it hits this TODO in bun:

if (isNodeStreamReadable(item)) {
if (Object.hasOwn(item, "fd") && typeof item.fd === "number") return item.fd;
if (item._handle && typeof item._handle.fd === "number") return item._handle.fd;
throw new Error(`TODO: stream.Readable stdio @ ${index}`);
}
if (isNodeStreamWritable(item)) {
if (Object.hasOwn(item, "fd") && typeof item.fd === "number") return item.fd;
if (item._handle && typeof item._handle.fd === "number") return item._handle.fd;
throw new Error(`TODO: stream.Writable stdio @ ${index}`);
}

It would be nice to be able to use this feature to write portable code.

What is the feature you are proposing to solve the problem?

Implement the TODO.

What alternatives have you considered?

Hack in some workarounds, I guess?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions