Skip to content

Instantly share code, notes, and snippets.

@Unknown025
Created October 17, 2020 09:27
Show Gist options
  • Save Unknown025/152b6d3722a8d626d1e6ade75e07c7b2 to your computer and use it in GitHub Desktop.
Save Unknown025/152b6d3722a8d626d1e6ade75e07c7b2 to your computer and use it in GitHub Desktop.
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