Open this example in the interactive library
Source code
import * as z from "node:zlib";
const data = Buffer.from("sample sample sample");
console.log(z.gunzipSync(z.gzipSync(data, { level: 1 })).equals(data));
Sample output
true

Open this example in the interactive library
import * as z from "node:zlib";
const data = Buffer.from("sample sample sample");
console.log(z.gunzipSync(z.gzipSync(data, { level: 1 })).equals(data));
true