Skip to main content
使用 Bun.deflateSync() 通过 DEFLATE 压缩 [Uint8Array]。
const data = Buffer.from("Hello, world!");
const compressed = Bun.deflateSync("Hello, world!");
// => Uint8Array

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

请参阅 文档 > API > 工具 了解更多的实用工具。