UNPKG

bun-types

Version:

Type definitions and documentation for Bun, an incredibly fast JavaScript runtime

21 lines (15 loc) 441 B
--- title: Compress and decompress data with DEFLATE sidebarTitle: DEFLATE compression mode: center --- Use `Bun.deflateSync()` to compress a `Uint8Array` with DEFLATE. ```ts const data = Buffer.from("Hello, world!"); const compressed = Bun.deflateSync("Hello, world!"); // => Uint8Array const decompressed = Bun.inflateSync(compressed); // => Uint8Array ``` --- See [Docs > API > Utils](/docs/runtime/utils) for more useful utilities.