Skip to content

ReadableStream 을 디스크에 쓰려면 먼저 스트림에서 Response 인스턴스를 생성합니다. 이 ResponseBun.write() 를 사용하여 디스크에 쓸 수 있습니다.

ts
const stream: ReadableStream = ...;
const path = "./file.txt";
const response = new Response(stream);

await Bun.write(path, response);

Bun.write() 의 전체 문서는 문서 > API > 파일 I/O 를 참조하세요.

Bun by www.bunjs.com.cn 편집