RuntimePackage ManagerBundlerTest RunnerLinterFormatterGuidesReferenceBlogFeedback

Write to stdout

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

TypeScript
console.log("Lorem ipsum");

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

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

See Bun.write().