Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ehmicky opened this issue Mar 17, 2024 · 0 comments
Open

Comments

@ehmicky
Copy link
Collaborator

ehmicky commented Mar 17, 2024

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).)

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

No branches or pull requests

1 participant