> ## Documentation Index
> Fetch the complete documentation index at: https://bun.ll1025.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 读取子进程的标准输出

当你使用 [`Bun.spawn()`](/runtime/child-process) 衍生子进程时，`proc.stdout` 是一个包含子进程 `stdout` 的 `ReadableStream`。

```ts theme={null}
const proc = Bun.spawn(["echo", "hello"]);

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

***

若要将子进程的 `stdout` 管道到父进程的 `stdout`，请将 `stdout` 选项设置为 `"inherit"`。

```ts theme={null}
const proc = Bun.spawn(["echo", "hello"], {
  stdout: "inherit",
});
```

***

参见 [子进程](/runtime/child-process)。
