使用 Bun.gzipSync()
壓縮 Uint8Array
。
const data = Buffer.from("Hello, world!");
const compressed = Bun.gzipSync(data);
// => Uint8Array
const decompressed = Bun.gunzipSync(compressed);
// => Uint8Array
請參閱 文件 > API > 工具 以取得更多有用的工具。
使用 Bun.gzipSync()
壓縮 Uint8Array
。
const data = Buffer.from("Hello, world!");
const compressed = Bun.gzipSync(data);
// => Uint8Array
const decompressed = Bun.gunzipSync(compressed);
// => Uint8Array
請參閱 文件 > API > 工具 以取得更多有用的工具。