Live data from Hacker News

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

stuk.github.io

51–57 of 57 posts

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

#51
post #14

We use jszip for parsing xlsx/xlsm/xlsb files in the browser (Excel 2007+ files are zip files that contain XML or binary files in specific locations): https://github.com/SheetJS/js-xlsx JSZip works well for small files, but unzipping XLSB files larger than 50M seem to cause out of memory issues in Firefox

Have you considered zip.js instead? It claims to work with files up to 4GB. It also can zip large files without any issues for me in Firefox.

When we first evaluated options, zip.js only supported IE9+ (and IE6-8 were still relevant browsers) while JSZip supports IE6+. In fact, the Base64 text box was introduced in http://oss.sheetjs.com/js-xlsx/ specifically to test IE6-9 (which do not support the HTML5 File API)

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

#52
post #51

Earlier quoted context omitted.

Have you considered zip.js instead? It claims to work with files up to 4GB. It also can zip large files without any issues for me in Firefox.

When we first evaluated options, zip.js only supported IE9+ (and IE6-8 were still relevant browsers) while JSZip supports IE6+. In fact, the Base64 text box was introduced in http://oss.sheetjs.com/js-xlsx/ specifically to test IE6-9 (which do not support the HTML5 File API)

I see. Inevitably its support for older browsers makes it slower, however.

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

#54
Holy carp on a stick, that was so easy. You've made my day today.

BTW, here is how I make files download with the filename that I want: https://github.com/capnmidnight/JWD/blob/master/html5/deskto...

The call to the "a" function on line 8 is just generating an HTML anchor tag. You should be able to figure it out from there.

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

#55
post #10

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…

I'm surprised that no one has brought up that this is also solved at the protocol level with SPDY and eventually HTTP 2 (and by HTTP pipelining, which is sadly never going to happen). Not a silver bullet, but a bit more sane than unzipping a set of images in JS.

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

#56
post #26

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.

Server-side languages, yes. There are lots of those, so each one doesn't impact many. But there's only one client-side language on the web, so it impacts everyone.

So we are reporting it just because it is JavaScript.

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

#57
post #56

Earlier quoted context omitted.

Server-side languages, yes. There are lots of those, so each one doesn't impact many. But there's only one client-side language on the web, so it impacts everyone.

So we are reporting it just because it is JavaScript.

Yes. JavaScript is lingua franca of the Web, so it may be important to have a particular functionality implemented in JavaScript.

This way, if you, say, want to take a part of the program and use it elsewhere, you have the advantage of the same language. If you want to ask a question about the program, you can count on other people knowing the language. If you want to illustrate something using a program, you have a common ground here.

Post reply on HN