> ## 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.

# 写入标准输出

`console.log` 函数写入 `stdout` 并在打印的数据后追加换行符。

```ts theme={null}
console.log("Lorem ipsum");
```

***

Bun 还通过 `Bun.stdout` 属性将 `stdout` 暴露为 `BunFile`。将其作为目标传递给 [`Bun.write()`](/runtime/file-io#writing-files-bun-write)。

```ts theme={null}
await Bun.write(Bun.stdout, "Lorem ipsum");
```

***

参见 [`Bun.write()`](/runtime/file-io#writing-files-bun-write)。
