zip.on('error', (err) => { throw err; });
yauzl.open(this.path, { lazyEntries: true }, function (err, zipfile) { if (err) { callback(err); return; } function next() { zipfile.readEntry(); } zipfile.on('entry', function (entry) { callback(null, zipfile, entry, next); }); zipfile.on('end', function () { if (utils.isFunction(onEnd)) { onEnd(); } }); next(); });
zipFile.on("entry", (entry) => { if (/\/$/.test(entry.fileName)) return zipFile.readEntry();
return callback(err); zipfile.on('end', function () { zipfile.close(); return callback(null, _unzippedFiles); }); zipfile.on('error', callback); zipfile.readEntry(); zipfile.on('entry', function (entry) { var _unzippedFile = { name : entry.fileName, readStream.on('data', function (data) { buffers.push(data); }); readStream.on('end', function () { _unzippedFile.data = Buffer.concat(buffers); zipfile.readEntry(); }); readStream.on('error', function (err) { zipfile.close(); return callback(err);
zipFile.on("entry", function(entry) { const fileName = entry.fileName.toString("utf8") if(fileName.endsWith("/")){ zipFile.openReadStream(entry, function(err, readStream) { if (err) throw err; readStream.on("end", function() { setTimeout(() => { let content = fs.readFileSync(filePath, "utf-8") zipFile.openReadStream(entry, function(err, readStream) { if(err)throw err; readStream.on("end", function() { if(onEnd)onEnd() zipFile.readEntry(); }).on("error", (err) => { zipFile.close() console.error(err) }).on("end", () => resolve()) .on("error", (err) => { zipFile.close() console.error(err)