-
Notifications
You must be signed in to change notification settings - Fork 357
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
Read from stdin and write to stdout #175
Comments
Yes, what you have there is an async iterator reading from stdin stream! These APIs will eventually be implemented in Rust. It's on the Roadmap but the streams API is rather complex so will take a while before we can ship it |
For Bun I would suggest using This works to write to standard output
This does not work for reading standard input stream
|
@richarddavison How is standard input intended to be read at all right now? Particularly from a non TTY? |
@andy-portmen This is what I came up with for reading standard input stream as a async iterable. I'm skeptical about WHATWG
This is what I do in Bun world to write to standard output https://github.com/guest271314/NativeMessagingHosts/blob/main/nm_host.js#L34-L43
https://github.com/guest271314/NativeMessagingHosts/blob/main/nm_host.js#L75-L82
|
@guest271314 Nice, thanks for sharing. |
Is there a plan to support reading from stdin and writing to stdout? For instance in BunJS, I can do streaming:
The text was updated successfully, but these errors were encountered: