node-archiver icon indicating copy to clipboard operation
node-archiver copied to clipboard

Zlib level doesn't have any change on the size of the archive

Open rajashree23 opened this issue 2 years ago • 2 comments

Hello! I use node-archiver to create an archive. I tried using different levels in lib but the archive size is the same i.e no compression is happening, and the output size is the summation of original data.

The following is a small part of my code

const archiver = require('archiver');
await new Promise((resolve, reject) => {  
        //Creating archiver
        const archive = archiver("zip", {zlib: { level: 9}});
        archive.on('error', reject);
       
        uploadStream.on('close', resolve);
        uploadStream.on('end', resolve);
        uploadStream.on('error', reject);

        //connecting archive to uploadStream via pipe.
        archive.pipe(uploadStream);
        s3FileStreams.forEach(s3FileStream => {
            archive.append(s3FileStream.stream, {
                name: s3FileStream.fileName
            });
        });
        archive.finalize();
    }).catch(error => {
        logger.error(metadata, error.message);
    });

It happens that no matter the zlib level I choose, the archive has still the same size. I am using three files of 30, 60,100MB respectively and the output is 190MB.

I tried the following methods but the output is still the same

  • reducing version
  • different levels

Can someone please help me out here as it is a very high priority task from my end?

rajashree23 avatar Jun 06 '22 06:06 rajashree23

Hi, same issue here.

leny avatar Jun 24 '22 09:06 leny

same here

cor1 avatar Sep 28 '22 21:09 cor1