Touffy / client-zip

A client-side streaming ZIP generator
MIT License
351 stars 22 forks source link

Read a zip #16

Closed Androz2091 closed 3 years ago

Androz2091 commented 3 years ago

Hello Could you add a way to read a zip file? Jszip is pretty slow for that too

Touffy commented 3 years ago

Hi there. First, do you have a use case for reading ZIP files in the client ? just curious.

Reading ZIP files (reliably) is pretty tricky, considering all the different, more or less quirky pieces of software that make them. Depending on what you expect and what kind of ZIP files you'll need to handle (which extra fields you care about, which compression algorithms and other features), there's a lot of work there.

Also, reading ZIP files cannot be implemented on a stream in the general case, and working around the browser limitations on memory and random access would be an additional source of complexity.

Now, I do think it is an interesting project. But it's not something I think fits into client-zip. I am of course open to arguments for unzipping in client-zip, but meanwhile, I can suggest another library. While searching for Zip64 information last week I discovered Conflux, it's modern and more ambitious in scope than client-zip (it unzips, and has compression), uses streams too. Doesn't do Zip64 yet, despite the search that lead me there. I'm not sure how actively it's being developed right now, but give it a shot ? If you care about speed, you should open a PR there to port my CRC32 WebAssembly code.

Touffy commented 3 years ago

I'm closing this for now. Like I said, by design, client-zip is not a Zip reader.