Sync Child Stdin Read
I'd like to make a JS wrapper around the repl of another language.
For example:
I can spawn a repl in a subprocess, keep it open and hook into the stdin/out/err of it. Then the idea would be to do something like the following:
The problem is something like that^ needs to run inside of a getter for
I can do some incredibly hacky work, like funneling stdout to a file and then sync-reading (.seek()) the file over and over. But surely there's a better way.
Relevant documentation on streams:
https://deno.land/api@v1.38.5?s=ReadableStreamBYOBReader
For example:
I can spawn a repl in a subprocess, keep it open and hook into the stdin/out/err of it. Then the idea would be to do something like the following:
The problem is something like that^ needs to run inside of a getter for
console.log(b.a) to work. E.g. no async.I can do some incredibly hacky work, like funneling stdout to a file and then sync-reading (.seek()) the file over and over. But surely there's a better way.
Relevant documentation on streams:
https://deno.land/api@v1.38.5?s=ReadableStreamBYOBReader

