I’ve found three npm packages that fail to gunzip with fflate (the resulting length is 0), but work with Node.js’s zlib. Here’s a full repro:
// index.mjs
import { gunzipSync as zlibGunzipSync } from "zlib";
import { gunzipSync } from "fflate";
const brokenPackages = [
"https://registry.npmjs.org/openurl/-/openurl-1.0.2.tgz",
"https://registry.npmjs.org/is/-/is-0.0.7.tgz",
"https://registry.npmjs.org/youtube/-/youtube-0.0.5.tgz",
];
for (const url of brokenPackages) {
const tarballData = new Uint8Array(
await fetch(url).then((r) => r.arrayBuffer())
);
console.log("fflate", gunzipSync(tarballData).length);
console.log("zlib", zlibGunzipSync(tarballData).length);
}