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 > 工具程式以取得更多實用的工具程式。