Skip to content

使用 Bun.gzipSync() 用 gzip 壓縮 Uint8Array

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

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

請參閱 文檔 > API > Utils 獲取更多有用的工具函數。

Bun學習網由www.bunjs.com.cn整理維護