Bun は Bun.stdout プロパティで stdout を BunFile として公開しています。これは Bun.write() の宛先として使用できます。
このコードは、Unix の cat コマンドと同様に、ファイルを stdout に書き込みます。
ts
const path = "/path/to/file.txt";
const file = Bun.file(path);
await Bun.write(Bun.stdout, file);Bun.write() の完全なドキュメントについては、ドキュメント > API > ファイル I/O を参照してください。