Skip to content
NewBun 1.4.5 is out. Release notes
AphrodyBun

Guides · File System

Write to stdout

Print to standard output with console.log or by passing Bun.stdout to Bun.write().

The console.log function writes to stdout and appends a line break to the printed data.

console.log("Lorem ipsum");

Bun also exposes stdout as a BunFile with the Bun.stdout property. Pass it as the destination to Bun.write().

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

See Bun.write().