Skip to content

Bun.deflateSync() を使用して Uint8Array を DEFLATE で圧縮します。

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

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

さらに便利なユーティリティについては、ドキュメント > API > ユーティリティ を参照してください。

Bun by www.bunjs.com.cn 編集