Bun 實作了 Web 標準 TextDecoder
類別,用於在二進制資料類型和字串之間轉換。
const buf = new ArrayBuffer(64);
const decoder = new TextDecoder();
const str = decoder.decode(buf);
請參閱 文件 > API > 二進制資料,以取得使用 Bun 操作二進制資料的完整文件。
Bun 實作了 Web 標準 TextDecoder
類別,用於在二進制資料類型和字串之間轉換。
const buf = new ArrayBuffer(64);
const decoder = new TextDecoder();
const str = decoder.decode(buf);
請參閱 文件 > API > 二進制資料,以取得使用 Bun 操作二進制資料的完整文件。
套件管理器
將 bun install 與 Artifactory 結合使用
設定 git 以 diff Bun 的 lockb lockfile
在 GitHub Actions 中使用 Bun 安裝相依性
讀取檔案
執行階段
串流
將 ReadableStream 轉換為 Uint8Array
將 ReadableStream 轉換為 ArrayBuffer
將 Node.js Readable 轉換為 Uint8Array
工具程式