rembrembdocs

Skip to main content

Bun home pagelight logodark logo

[Runtime

](../../../index.md)[Package Manager

](../../../pm/cli/install/index.md)[Bundler

](../../../bundler/index.md)[Test Runner

](../../../test/index.md)[Guides

](../../index.md)[Reference

](https://bun.com/reference)[Blog

](https://bun.com/blog)[Feedback

](../../../feedback/index.md)

The console.log function writes to stdout. It will automatically append a line break at the end of the printed data.

console.log("Lorem ipsum");

For more advanced use cases, Bun exposes stdout as a BunFile via the Bun.stdout property. This can be used as a destination for Bun.write().

await Bun.write(Bun.stdout, "Lorem ipsum");

See Docs > API > File I/O for complete documentation of Bun.write().

Was this page helpful?

Suggest editsRaise issue

[

Write a ReadableStream to a file

Previous

](../stream/index.md)[

Write a file to stdout

Next

](../cat/index.md)