node-archiver
node-archiver copied to clipboard
Zlib level doesn't have any change on the size of the archive
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?
Hi, same issue here.
same here