Dev Helpers
← Back

Round-trip gzip

Round-trip gzip using Node.js.

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)).toString());

Sample output

sample sample sample