ReadableStream 을 디스크에 쓰려면 먼저 스트림에서 Response 인스턴스를 생성합니다. 이 Response 는 Bun.write() 를 사용하여 디스크에 쓸 수 있습니다.
ts
const stream: ReadableStream = ...;
const path = "./file.txt";
const response = new Response(stream);
await Bun.write(path, response);Bun.write() 의 전체 문서는 문서 > API > 파일 I/O 를 참조하세요.