Bun provides a browser- and Node.js-compatible console
global. This page only documents Bun-native APIs.
Object inspection depth
You can configure how deeplyconsole.log() prints nested objects:
- CLI flag: Use
--console-depth <number>to set the depth for a single run - Configuration: Set
console.depthin yourbunfig.tomlto persist it across runs - Default: Objects are inspected to a depth of
2levels
Reading from stdin
In Bun, theconsole object is also an AsyncIterable that reads process.stdin line by line.
terminal