TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

JSZip: Create, read and edit .zip files with JavaScript

113 pointsby saltcookieabout 11 years ago

15 comments

sheetjsabout 11 years ago
We use jszip for parsing xlsx&#x2F;xlsm&#x2F;xlsb files in the browser (Excel 2007+ files are zip files that contain XML or binary files in specific locations): <a href="https://github.com/SheetJS/js-xlsx" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;SheetJS&#x2F;js-xlsx</a><p>JSZip works well for small files, but unzipping XLSB files larger than 50M seem to cause out of memory issues in Firefox
评论 #7616184 未加载
评论 #7616925 未加载
allthatisgoldabout 11 years ago
I tried JSZip not too long ago for my side project and it was quite slow. I&#x27;ve been using <a href="http://gildas-lormeau.github.io/zip.js/" rel="nofollow">http:&#x2F;&#x2F;gildas-lormeau.github.io&#x2F;zip.js&#x2F;</a> and I&#x27;m very happy with it. I hope to release my web app some time this week.
评论 #7616923 未加载
artellectualabout 11 years ago
Actually, one of the best use case for this is, when a user wants to upload multiple images &#x2F; files, we can use the html5 file api with zip js generate 1 zip file and upload just that one file and extract on the server. It will be much faster. And actually you can use this in the web worker api so it doesn&#x27;t block the Ui thread
nanidinabout 11 years ago
Potential use case: instead of using CSS sprite maps (putting all of your images into one image to reduce the number of http requests generated by your page, then using css magic to select regions inside of that image), image files could be zipped into an image package that is delivered to the client, who unzips it and uses the images inside. This would cut down on the number of requests made, but allow the images to be used as normal images instead of as images within a sprite sheet.
评论 #7615813 未加载
评论 #7615725 未加载
评论 #7615755 未加载
评论 #7616433 未加载
评论 #7618181 未加载
bhoustonabout 11 years ago
We&#x27;ve used <a href="https://github.com/EvanOxfeld/node-unzip/issues" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;EvanOxfeld&#x2F;node-unzip&#x2F;issues</a> in production and we&#x27;ve had a surprising number of corrupt zip files created by it. We&#x27;ve switched to using a barely wrapped zip command line tool.<p>Is PSZIp better?
ff7c11about 11 years ago
It&#x27;s really fast at reading zip files created by Google takeout. I use it at <a href="http://theyhaveyour.info" rel="nofollow">http:&#x2F;&#x2F;theyhaveyour.info</a> as it works perfectly with the FileReader API. For reading only though - haven&#x27;t tried writing with it.
moron4hireabout 11 years ago
Holy carp on a stick, that was so easy. You&#x27;ve made my day today.<p>BTW, here is how I make files download with the filename that I want: <a href="https://github.com/capnmidnight/JWD/blob/master/html5/desktop.js#L6-L16" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;capnmidnight&#x2F;JWD&#x2F;blob&#x2F;master&#x2F;html5&#x2F;deskto...</a><p>The call to the &quot;a&quot; function on line 8 is just generating an HTML anchor tag. You should be able to figure it out from there.
ragecoreabout 11 years ago
Why not unrar and untar using javascript as well?<p><a href="https://github.com/varunmayya/bitjs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;varunmayya&#x2F;bitjs</a>
napoleondabout 11 years ago
If you&#x27;re purely interested in client-side compression in the browser (i.e. compatibility with server libraries&#x2F;filesystem tools is not important) it&#x27;s possible to get better compression in less time using <a href="http://pieroxy.net/blog/pages/lz-string/index.html" rel="nofollow">http:&#x2F;&#x2F;pieroxy.net&#x2F;blog&#x2F;pages&#x2F;lz-string&#x2F;index.html</a>
moron4hireabout 11 years ago
This is exactly a project I was about to embark upon to generate ePub files from client-side JS. Thanks!
评论 #7615956 未加载
nawitusabout 11 years ago
Does this handle very large files on Node.js? npm for one fails with large files, by &quot;large&quot; I mean something like a few hundred megabytes. It&#x27;s very problematic especially on Windows.
klungerabout 11 years ago
Am I misunderstanding this, or could this be used to send a client a large amount of data in a zip file? Let&#x27;s say the client is using WebView...
na85about 11 years ago
&gt;JavaScript today is capable of generating a lot of data. The easiest way to deliver multiple files to your users is in a zip file. Instead of wasting server resources and bandwidth you can get the client to do it for you.<p>... Am I not understanding what they&#x27;re saying here or do the authors really not understand how the internet works?<p>It looks to me like they&#x27;re saying &quot;don&#x27;t bother letting your users download zip files. Save your bandwidth! Just get them to send themselves a zip file, client-side!&quot;
评论 #7615677 未加载
评论 #7615665 未加载
评论 #7615827 未加载
评论 #7616171 未加载
评论 #7615670 未加载
评论 #7615664 未加载
评论 #7615669 未加载
clxlabout 11 years ago
Atwood&#x27;s law in action
collywabout 11 years ago
Is this really news? Almost every server side language out there will have a zip library, and I doubt any of those got mentioned on HN.
评论 #7616315 未加载