deno
deno copied to clipboard
Deno.command spawn stdout hangs on read
deno 1.41.1 (release, x86_64-pc-windows-msvc) v8 12.1.285.27 typescript 5.3.3
I am trying to run a python command "python ...path/file.py" I need to read the response to see if it started up correctly.
From deno.
const command = new Deno.Command(this.#command, {
args: this.#args,
stdout: "piped"
});
this.#childProcess = await command.spawn();
const success = await read_stdout(this.#childProcess);
in read_stdout I have this
const decoder = new TextDecoder();
const reader = process.stdout.getReader();
const read_value = (await reader.read()).value;
const text = decoder.decode(read_value);
but on the reader.read it just hangs for ever