console object is an AsyncIterable that yields lines from stdin.
Running this file starts a never-ending interactive prompt that echoes whatever you type.
terminal
Bun also exposes
stdin as a BunFile, Bun.stdin. Use it to incrementally read large inputs piped into the bun process.
Chunks aren’t guaranteed to be split line-by-line.
Running
stdin.ts prints whatever is piped into it.
terminal
See Utils for more utilities.