Judging by the API docs, a Deno subprocess (an instance of Deno.Process
) can receive one of four stdin types, the same goes for stdout. However, there's no mention in the documentation as to how to pipe the output from one subprocess to the input of another. What I'm trying to achieve is akin to the basic UNIX pipe (oneProcess | another
) and then read the output of the second process in the pipeline. Simply running
const someProcess = Deno.run({
cmd: ["oneProcess firstParameter | another 2ndParameter"]
});
fails with an error of:
error: Uncaught NotFound: No such file or directory (os error 2)
because the first argument (string) is expected to be an executable.
How would one achieve this is Deno then, are we required to perhaps set "piped"
as both the output and input to the subprocesses (respectively) and then manually read and write data from one to another?
oneProcess
not existing. I'll post an answer in a bit. – Oster