Content-Length: 484062 | pFad | https://bun.com/guides/process/spawn-stdout

X Read stdout from a child process - Bun
Skip to main content
When using Bun.spawn(), the stdout of the child process can be consumed as a ReadableStream via proc.stdout.
const proc = Bun.spawn(["echo", "hello"]);

const output = await proc.stdout.text();
output; // => "hello"

To instead pipe the stdout of the child process to stdout of the parent process, set “inherit”.
const proc = Bun.spawn(["echo", "hello"], {
  stdout: "inherit",
});

See Docs > API > Child processes for complete documentation.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://bun.com/guides/process/spawn-stdout

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy