Tiny unzip library (<1KB) for Node.js and browsers, current version 0.1.10. Released sporadically, no fixed cadence. Differentiator: minimal size, synchronous entry iteration, automatic use of built-in decompression APIs (zlib in Node, DecompressionStream in modern browsers). Optionally supports pako as fallback for older environments. No streaming, no ZIP64 support. Ships TypeScript definitions.
npm install but-unzipNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Reads a zip file synchronously, iterates entries, and decompresses each entry's data asynchronously.
Do not use but-unzip with ZIP64 archives. Consider a full-featured alternative like adm-zip or yauzl.
Always `await` the return value of `.read()` to be safe in all environments.
Use `import` syntax or a dynamic import. If your project uses CommonJS, consider using a bundler or switching to ESM.
Use `import { unzip, inflateRaw as platformInflateRaw } from 'but-unzip';` and supply an alternative like `pako.inflateRaw` if `platformInflateRaw` is null.Use dynamic import: `const { iter } = await import('but-unzip');` or add `"type": "module"` to package.json.Ensure you iterate correctly: `for (const entry of iter(bytes)) { await entry.read(); }`.Use a different library that supports the compression method, or re-compress the archive with deflate.
No dependency data recorded yet.