# Bun Read stdout from a child process

> Read stdout from a child process

- Skill: `jarle/bun-read-stdout-from-a-child-process` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jarle/bun-read-stdout-from-a-child-process`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jarle/bun-read-stdout-from-a-child-process/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jarle (https://skillmd.com/u/jarle)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/jarle/bun-read-stdout-from-a-child-process

---


# Read stdout from a child process

When using [`Bun.spawn()`](/runtime/child-process), the `stdout` of the child process can be consumed as a `ReadableStream` via `proc.stdout`.

```ts  theme={"theme":{"light":"github-light","dark":"dracula"}}
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".

```ts  theme={"theme":{"light":"github-light","dark":"dracula"}}
const proc = Bun.spawn(["echo", "hello"], {
  stdout: "inherit",
});
```

***

See [Docs > API > Child processes](/runtime/child-process) for complete documentation.

