const process = new Deno.Command("top", { stdout: "piped" }).spawn();async function reader() { const stream = process.stdout .pipeThrough(new TextDecoderStream()) for await (const message of stream) { console.log(message); }}reader(); // not calling await so its "non blocking"
new Deno.Command("uptime") .output() .then((x) => new Response(x.stdout).text()) .then(console.log);