Skip to main content

Compress and decompress data with DEFLATE

Use Bun.deflateSync() to compress a Uint8Array with DEFLATE.

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

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

See Utils.

Translation © 2026 fanyi.dev · Original © 2026 the Bun project (LICENSE.md names no copyright holder) (MIT)