When i try to extract one file using node.js with package node-stream-zip its getting error like code: "Z_DATA_ERROR" errno: -3 message: "too many length or distance symbols" stack: "Error: too many length or distance symbols↵ at Zlib.zlibOnError [as onerror] (zlib.js:168:17)" i analyzed my file compression method which is Deflate64 in my knowledge node-stream-zip package only supporting Deflate64 (compression type : 9 )
here is my code.
const StreamZip = require('node-stream-zip');
exports.unzip = function (zipPath, targetDir, completeHandler, progressHandler, errHandler) {
const zip = new StreamZip({
file: zipPath,
storeEntries: true,
});
var me = this;
me.createDirIfNotExist(targetDir);
zip.on('error', (error) => {
if (errHandler) {
console.log(error)
errHandler(error);
}
});
zip.on('ready', () => {
me.createDirIfNotExist(targetDir);
const entries = zip.entries();
const totalEntries = Object.keys(entries).length;
let extractedEntries = 0;
for (const entryName in entries) {
const entry = entries[entryName];
zip.extract(entry.name, `${targetDir}/${entry.name}`, (err) => {
if (err) {
if (errHandler) {
console.log(err)
errHandler(err);
}
} else {
extractedEntries++;
if (progressHandler) {
const progress = (extractedEntries / totalEntries) * 100;
progressHandler();
}
if (extractedEntries === totalEntries) {
zip.close();
if (completeHandler) {
completeHandler();
}
}
}
});
}
});
};
i need to extract Deflate64 method files in node.js using any package. i tried node-stream-zip, unzipper, decompress-zip, adm-zip, jszip