使用 Bun.gzipSync()
以 gzip 壓縮 Uint8Array
。
const data = Buffer.from("Hello, world!");
const compressed = Bun.gzipSync(data);
// => Uint8Array
const decompressed = Bun.gunzipSync(compressed);
// => Uint8Array
請參閱文件 > API > 工具程式以取得更多實用工具程式。
使用 Bun.gzipSync()
以 gzip 壓縮 Uint8Array
。
const data = Buffer.from("Hello, world!");
const compressed = Bun.gzipSync(data);
// => Uint8Array
const decompressed = Bun.gunzipSync(compressed);
// => Uint8Array
請參閱文件 > API > 工具程式以取得更多實用工具程式。
套件管理器
設定 git 以 diff Bun 的 lockb lockfile
在 GitHub Actions 中使用 Bun 安裝相依性
讀取檔案
執行階段
串流
將 ReadableStream 轉換為 Uint8Array
將 ReadableStream 轉換為 ArrayBuffer
將 Node.js Readable 轉換為 Uint8Array
工具程式