Skip to content

Add .readableStream(), .writableStream() and .transformStream() methods #913

Open
@ehmicky

Description

@ehmicky

See #143 (comment)

We should add subprocess.readableStream(), subprocess.writableStream() and subprocess.transformStream(). Those behave like subprocess.readable(), subprocess.writable() and subprocess.duplex() (see #912) but return web streams instead of Node.js streams.

One approach would be to use Readable.toWeb(subprocess.readable()), Writable.toWeb(subprocess.writable()) and Duplex.toWeb(subprocess.duplex()).
Another approach would be to re-implement this from scratch, i.e. call new ReadableStream(...) and so on.

Regardless, this should be tested thoroughly, just like the Node.js streams methods.

(Note to implementer: we need to remember to make it work on early errors too (see https://github.com/sindresorhus/execa/blob/main/lib/return/early-error.js).)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions