-
-
Save Unknown025/152b6d3722a8d626d1e6ade75e07c7b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const shelljs = require('shelljs'); | |
const directory = "./mcheli"; | |
const name = "mcheli"; | |
const zip = new StreamZip({ | |
file: path.join(directory, name + ".zip"), | |
storeEntries: true, | |
skipEntryNameValidation: true | |
}) | |
zip.on('ready', () => { | |
if (!fs.existsSync(path.join(directory, name))) | |
shelljs.mkdir('-p', path.join(directory, name)); | |
zip.extract(null, path.join(directory, name), err => { | |
if (err) throw err; | |
zip.close(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment