stdin
. In Bun, the console
object is an AsyncIterable
that yields lines from stdin
.
Running this file results in a never-ending interactive prompt that echoes whatever the user types.
terminal
Bun also exposes stdin as a
BunFile
via Bun.stdin
. This is useful for incrementally reading large inputs that are piped into the bun
process.
There is no guarantee that the chunks will be split line-by-line.
This will print the input that is piped into the
bun
process.
terminal
See Docs > API > Utils for more useful utilities.