decompress-zip icon indicating copy to clipboard operation
decompress-zip copied to clipboard

request: browser support

Open max-mapper opened this issue 12 years ago • 5 comments

it would be sweet to use this client-side, but some things would need to change first:

  • remove assumption that a filename will be passed in and a folder will be created + extracted to
  • instead have an abstract interface that requests byte ranges (e.g. what getBuffer is doing) but is decoupled from fs. that way it can be hooked up to FileReader in the browser. require('fs') would have to move to separate node-only file from the extraction logic. the extraction logic would be generic so that it can run in the browser or in node
  • also abstract the extraction so that instead of passing in a destination folder you can just get a readable stream for each file file extraction

max-mapper avatar Feb 15 '14 21:02 max-mapper

remove assumption that a filename will be passed in and a folder will be created + extracted to instead have an abstract interface that requests byte ranges

:+1: This should really be the case regardless of browser support. Requiring an actual file makes it hard to use in cases where you just operate in-memory. Like with gulp.

sindresorhus avatar Feb 15 '14 21:02 sindresorhus

This seems like it would be a very hard thing to do. There are very many places that assume you are using Node. How good is browserify with things like this?

wibblymat avatar Mar 27 '14 14:03 wibblymat

:+1:

Would love this. Any decent alternatives yet?

timdp avatar Jan 07 '15 15:01 timdp

@timdp https://stuk.github.io/jszip/

sindresorhus avatar Jan 07 '15 16:01 sindresorhus

Right before I saw your comment, I finished writing some Promise wrappers around zip.js. Thanks though. :smile:

timdp avatar Jan 07 '15 19:01 timdp