GithubHelp home page GithubHelp logo

Comments (10)

101arrowz avatar 101arrowz commented on May 18, 2024 4

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.

101arrowz avatar 101arrowz commented on May 18, 2024 2

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.

101arrowz avatar 101arrowz commented on May 18, 2024 1

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.

paambaati avatar paambaati commented on May 18, 2024 1

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.

101arrowz avatar 101arrowz commented on May 18, 2024 1

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.

101arrowz avatar 101arrowz commented on May 18, 2024 1

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.

paambaati avatar paambaati commented on May 18, 2024 1

8F275738-7809-4064-8FCE-10B0802FA401

from fflate.

paambaati avatar paambaati commented on May 18, 2024

@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.

paambaati avatar paambaati commented on May 18, 2024

Sounds great. Would it also fallback to the main thread if the browser doesn’t support workers?

from fflate.

101arrowz avatar 101arrowz commented on May 18, 2024

I've finished adding Worker support, now I'm adding ZIP APIs.

from fflate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.