Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is jszip unmaintained? #915

Open
gruenich opened this issue Jan 8, 2024 · 9 comments
Open

Is jszip unmaintained? #915

gruenich opened this issue Jan 8, 2024 · 9 comments

Comments

@gruenich
Copy link

gruenich commented Jan 8, 2024

Is jszip unmaintained? No release or commit since August of 2022. There are plenty of merge requests and issues.

I am not judging, I wanted to know the status. Maybe some backgrounds like: Lack of interest? Lack of money? Would someone be interested in taking over this project?

@kibertoad
Copy link

kibertoad commented Jan 18, 2024

I would be open to co-maintaing the library. @Stuk - would you be open to that?

@numericOverflow
Copy link

Tagging along for the answer.

Again, @Stuk it's an awesome util, just want to know current state for planning choices!

@unilynx
Copy link

unilynx commented Apr 22, 2024

Same question. Also I'm considering whether it would be worth forking jszip to remove pako as a dependency, as nodejs comes with zlib.

(and even browsers seem to have (de)compression support now - https://developer.mozilla.org/en-US/docs/Web/API/Compression_Streams_API - although I'm personally only interested in the serverside use case now)

@offaxis
Copy link

offaxis commented Apr 23, 2024

Great work ! But is it still maintained ? What are the alternatives ?

@unilynx
Copy link

unilynx commented Apr 23, 2024

Great work ! But is it still maintained ? What are the alternatives ?

For nodejs, https://www.npmjs.com/package/node-stream-zip is an alternative for decompressing - I've just successfully integrated it. You can pass a file path to it which reduces the memory requirements - in nodejs, jszip wants the file to be decompressed in a Buffer, which is not an option for me with multi-GB zip files

Neither supports nodejs's Blobs unfortunately - jszip seems to have some support for Blobs but only in its browser supporting parts, not in the nodejs parts. (I checked if there was quick fix for that, but jszip relies on FileReader to read Blobs which isn't available in Node 20)

@offaxis
Copy link

offaxis commented Apr 25, 2024

Thanks for your reply, but my needs is essentially for creating a zip archive.

@lpatiny
Copy link

lpatiny commented Apr 25, 2024

I did some tests with https://gildas-lormeau.github.io/zip.js/ and it seems pretty convincing. I was able to compress much faster that with jszip (factor 3 on my macbook air). Also it should be able to deal with Zip64 files (yes I have a zip of 29Gb ...) but I didn't try yet.

@unilynx
Copy link

unilynx commented Apr 25, 2024

@lpatiny nice find. zip.js wasn't on my shortlist yet. It seems to tick all the boxes...

This library works fully with the latest versions of Chrome, Firefox, Safari, Microsoft Edge, and Deno.

interestingly no mention of nodejs, but that's probably considered t one implicit, https://github.com/gildas-lormeau/zip.js/blob/master/package.json shows support for nodejs >= 16.5

factor 3 on my macbook air

yeah I was hoping for such numbers when not having to deal with a WASM version of zlib

@lpatiny
Copy link

lpatiny commented Apr 25, 2024

I tested it with nodeJS (type=module). Not sure the best way to use this library.

import { readdir, readFile } from 'fs/promises'
import { writeFileSync } from 'fs'
import { join } from 'path'

import { BlobWriter, Uint8ArrayReader, ZipWriter } from '@zip.js/zip.js'

const source = 'node_modules'
const lastPart = source.split('/').pop();

const files = (await readdir(new URL(source, import.meta.url), { recursive: true, withFileTypes: true })).filter(entry => entry.isFile());

// Creates a BlobWriter object where the zip content will be written.
const blobWriter = new BlobWriter();
const zipWriter = new ZipWriter(blobWriter);

const promises = [];
const pathReplacer = new RegExp(".*/" + lastPart);
for (const file of files) {
  const currentDir = file.path.replace(pathReplacer, '');
  const path = currentDir + (currentDir ? '/' : '') + file.name;
  promises.push(
    (async () => {
      const data = await readFile(join(file.path, file.name))
      const unit8ArrayReader = new Uint8ArrayReader(data);
      await zipWriter.add(path, unit8ArrayReader);
    })()
  );
}

await Promise.all(promises);
await zipWriter.close();
const zipFileBlob = await blobWriter.getData();
const array = new Uint8Array(await zipFileBlob.arrayBuffer());
writeFileSync(new URL('zipjs.zip', import.meta.url), array);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants