Bun

指南二進位資料

使用 Bun 將 Blob 轉換為字串

Blob 類別提供多種方法,可用於以不同格式使用其內容,包括 .text()

const blob = new Blob(["hello world"]);
const str = await blob.text();
// => "hello world"

請參閱 文件 > API > 二進位資料,以取得使用 Bun 操作二進位資料的完整文件。