#Log Deno.command process output

4 messages · Page 1 of 1 (latest)

wanton crystal
#

i need to execute a command wich will keep running until stopped and log the output.
i found this but it dosnt work

const command = new Deno.Command(
  "java",
  {
    args: [
      "-Xms512M",
      "-Xmx512M",
      "-XX:+UseG1GC",
      "-XX:G1HeapRegionSize=4M",
      "-XX:+UnlockExperimentalVMOptions",
      "-XX:+ParallelRefProcEnabled",
      "-XX:+AlwaysPreTouch",
      "-jar",
      "proxy.jar"
    ],
    stdout: "piped",
    stdin: "piped",
    stderr: "piped",
  },
);
const process = command.spawn();
for await (const line of readLines(process.stdout)) {
    emit_console_out(line);
}

this says: Argument of type 'ReadableStream<Uint8Array>' is not assignable to parameter of type 'Reader'. Property 'read' is missing in type 'ReadableStream<Uint8Array>' but required in type 'Reader'
and i know that process.stdout has a getReader but that dosnt seem to work either

tender ice
wanton crystal
#

alr thx il look into that

spark otter
#

hey @wanton crystal, do you have an example of how you converted this code with new functions?

for await (const line of readLines(process.stdout)) {
    emit_console_out(line);
}