aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/util/deflate.md
blob: 91dd8925ab8612b9dd0ae8edd3aa542049e5b09b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
---
name: Compress and decompress data with DEFLATE
---

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/api/utils) for more useful utilities.