DenoDDeno
Powered by
KayK
Denoβ€’3y agoβ€’
4 replies
Kay

Log Deno.command process output

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);
}
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'
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
getReader
but that dosnt seem to work either
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Empty output in Deno.Command
vwkdVvwkd / help
3y ago
How to log Deno.Command output in real time (not after command completes)
bombillazoBbombillazo / help
2y ago
Deno.Command output as it runs
bombillazoBbombillazo / help
3y ago