aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/util/gzip.md
blob: 380a56d8064e115af6447b28d29043fd81fc735c (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 gzip
---

Use `Bun.gzipSync()` to compress a `Uint8Array` with gzip.

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

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

---

See [Docs > API > Utils](/docs/api/utils) for more useful utilities.