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('error', callback); zipfile.readEntry(); zipfile.on('entry', function (entry) { var _unzippedFile = { if (/\/$/.test(entry.fileName)) { zipfile.readEntry(); readStream.on('end', function () { _unzippedFile.data = Buffer.concat(buffers); zipfile.readEntry(); }); readStream.on('error', function (err) {
const folderPath = join(modulePath, fileName) if(!fs.existsSync(folderPath))fs.mkdirSync(folderPath, {recursive: true}) zipFile.readEntry(); }else{ if(!exists){ }else{ let filePath = join(modulePath, fileName) if(filePath.endsWith(".asar"))return zipFile.readEntry(); if(fileName.endsWith(".node")){ hasNode = true extractFile() }else if(join(filePath, "..") === modulePath && filePath.endsWith(".js")){ if(patchedJS.includes(filePath))return zipFile.readEntry(); patchedJS.push(filePath) extractFile(() => { extractFile() }else{ zipFile.readEntry(); readStream.on("end", function() { if(onEnd)onEnd() zipFile.readEntry(); }).on("error", (err) => { zipFile.close() console.error(`[\x1b[31mERROR\x1b[0m] Please download manually. ${API_URL}/modules/${branch}/${module}/${moduleVersion}?platform=${platform}&host_version=${version}`)