adm-zip
adm-zip copied to clipboard
`extractAllTo` does not overwrite/replace existed folder when parameter is set to `true` or `false`.
Hello,
The method extractAllTo
does not work as expected and the documentation is not up to date (version 0.5.9)
This is my code:
const zipFile = new Zip('yolo.zip', {});
zipFile.extractAllTo('.', true, false, null);
Thx for your help :)
@percenuage I am facing the same issue. Did you find any solution? Or anyone can help with this?
yes if folder is already existing we use it and only if folder does not exist new folder is created.
Deleting old folders with ADM-ZIP is not good idea: Lets say you have half the files in one file and others in other file. So each time you try extract one of them previously extracted files are deleted with directories. I must say it may satisfy less than 1 % of the cases.
If empty folders are really needed. You should use package like rimraf
for making sure folders are empty. So they can be re- created.