Bun

指南實用程式

使用 Bun 壓縮和解壓縮 DEFLATE 資料

使用 Bun.deflateSync() 使用 DEFLATE 壓縮 Uint8Array

const data = Buffer.from("Hello, world!");
const compressed = Bun.deflateSync("Hello, world!");
// => Uint8Array

const decompressed = Bun.inflateSync(compressed);
// => Uint8Array

有關更多有用的工具,請參閱 文件 > API > 工具