Blob 類提供了多種方法來消費其內容,包括 .text()。
ts
const blob = new Blob(["hello world"]);
const str = await blob.text();
// => "hello world"有關使用 Bun 操作二進制數據的完整文檔,請參閱 文檔 > API > 二進制數據。