How to read stdin (and write to stdout)? #420
Replies: 2 comments 3 replies
-
What I tried so far was
Streams are transferable on Chromium and Chrome, and Firefox now. I achieved 1-3 then encountered these errors.
|
Beta Was this translation helpful? Give feedback.
-
Hi @guest271314,
|
Beta Was this translation helpful? Give feedback.
-
In QuickJS we can do something like this read from stdin, open a new process and pipe the output from the process to stdout, in this case to Chromium browser using Native Messaging, with something like
I'm checking out workerd for the server and streams capability, so I can use
fetch()
on any Web site and stream captured raw PCM to the browser where that audio is written to aMediaStreamTrackGenerator
that can be recorded and streamed to any other peer with WebRTC.Here I suspect workerd is not intended to be used to spawn child processes. That is fine. I can use QuickJS to launch workerd, and the child process that I can pipe to workerd to serve as a
ReadableStream
in aResponse
.I browsed through /io yet didn't locate any examples of reading from stdin.
Kindly direct me to where to read about or explain how to in code read input from stdin so I can write that data to a
ReadableStream
in workerd environment.Beta Was this translation helpful? Give feedback.
All reactions