const zipFile = zip.files[index] const filepath = path.join(dir, zipFile.name.replace(/\\/g, path.sep)) if (zipFile.dir === true) { if (!fs.existsSync(filepath)) fs.mkdirSync(filepath, {'mode': fstools.defaultMask}) process.stdout.write('Directory ' + filepath + '\n')