Skip to content

使用 Bun.deflateSync() 用 DEFLATE 压缩 Uint8Array

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

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

请参阅 文档 > API > Utils 获取更多有用的工具函数。

Bun学习网由www.bunjs.com.cn整理维护