Comments (10)
I just added ZIP support. The parallelized (asynchronous) version is extremely fast, even more so than many standalone C-based tools. Thanks for the feature request!
from fflate.
The entire lifecycle (creation, passing data, and destruction) will be done automatically. A new worker is created and destroyed each call. I'm doing it inline, so all bundlers should still work, and IE10+ is still supported. Honestly, I'm surprised nobody else has done this yet.
from fflate.
I'll get to this in a few days, after I add tests. Could you give a general sense of the API you'd like to use? For example, closer to UZIP or JSZip?
from fflate.
Awesome. I’d borrow the APIs (.zip()
and .unzip()
) from JSZip.
For an initial version, it could simply support File
objects, with Base64 files coming later.
I’d also love to be able to tweak the compression level. I’d imagine for people who just want to store quickly and don’t care for compression, level 0
would be useful, not to mention fast and lightweight too.
from fflate.
Quick update, I'm working on built-in Worker
support as a prerequisite to this because adding ZIP support but not compressing in parallel just feels wrong... it seems that nobody else is really making isomorphic workers, so I had to write a lot of extra code to make it work. Bundle size will probably increase a to around 13kB for non-ESM users, but I think the performance benefits are worth it.
from fflate.
No, it does not fall back, but I'm exporting both a synchronous and asynchronous (Worker) API, so it shouldn't matter if you're trying to support one of the very few browsers that supports Typed Arrays but not Web Workers (mainly Opera Mini).
from fflate.
from fflate.
@101arrowz That’s fantastic news! Would that mean it would take of registering/unregistering workers too? Or will there be specific methods to run the operations inside a Worker
?
from fflate.
Sounds great. Would it also fallback to the main thread if the browser doesn’t support workers?
from fflate.
I've finished adding Worker support, now I'm adding ZIP APIs.
from fflate.
Related Issues (20)
- Add Bzip2?
- Hangs on gunzipSync of compressed content with invalid dictionary HOT 3
- Option to shorten output as much as possible HOT 3
- Incorrect argument order in AsyncFlateStreamHandler HOT 5
- Truncated output of gunzip if SIZE footer is incorrect HOT 5
- return uncompressed size instead of resized output buffer HOT 4
- Improve zip documentation HOT 1
- The encoded data was not valid for encoding utf-8 HOT 1
- Streams onData do not work as expected anymore HOT 8
- CDN bundle for 0.8.1 is broken HOT 2
- Async unzip maxing out CPU and memory for some files HOT 3
- fflate.decompressSync is not a function when using `nifti-reader-js` (React) HOT 7
- Occasional CRC Errors When Streaming Data into Zip using AsyncZipDeflate HOT 7
- `zipSync` can get order of ZIP entries wrong, due to how objects work HOT 3
- delete the rust code
- The 2nd+ JPG images in a zip stream being created are corrupt for some reason? HOT 9
- `gunzipSync` failing (0 gzip length) on some npm package tarballs HOT 1
- Unexpected EOF when inflating ZIP HOT 3
- Unzip error thrown when big file as compression type 9 HOT 1
- Incorrect modules field for node.js HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fflate.