Closed greggman closed 5 years ago
Hey, that sounds great, thanks!
I still wonder, why some JS ZIP libraries are 10x larger than UZIP, while they do the same thing: https://github.com/Stuk/jszip
Is the module version needed? The NPM module (which is now pulling the exact code) can be used in bundlers like parcel and webpack, https://codesandbox.io/s/fancy-fog-1xfy9 is a live example.
And if I don't want to use a bundler? Also how about tree shaking? (note I have not finished make the code shakable)
Hi, thanks for makinga fork of UZIP.js ! BTW. I updated it yesterday, so you might want to update it, too.
Thanks for the heads up about the update. Do you have a zip file that failed before the change? I'd like to add a test
For each file, the ZIP stores both the size of compressed and original file. So it never failed for ZIP files.
But in many cases, (e.g. PDF files) ZLIB compression is used without knowing the size of decompressed data. So it is tricky to estimate how long array is needed for the output.
In the latest version, for each byte written to the output, it checks, if it will fit into the array, and if not, a bigger array is created and the content of the old array is copied into it.
For anyone who lands here looking for an ESM version of UZIP, I maintain one over here: https://github.com/TomasHubelbauer/esm-uzip-js
just fyi, i posted a es6 module based version of your library here
https://github.com/greggman/uzip-module
I hope that's okay. I'm happy to take it down or transfer it to you if you want.