You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
extractEntryTo not preserving subdirectories as of 0.4.11 #306
I recently upgraded from 0.4.10 to the latest (0.4.14) and found that extractEntryTo was no longer preserving subdirectories in my zip files. Instead it was unzipping everything into a flat folder.
These zip files contain a single top level entry which is a folder that contains the code. I want to unzip the contents of that folder into another folder. To do so I am doing this:
const AdmZip = require("adm-zip");
const zip = new AdmZip("/path/to/my/file.zip");
zip.extractEntryTo(zip.getEntries()[0], "myNewDirectory", false, true);
I expect myNewDirectory to hold the Github Repo code just as it looks in GitHub, but instead it contains no folders and every file is sitting flat inside myNewDirectory. This worked in 0.4.10 however when I tried rolling back versions I found it was broken in every version after 0.4.10.
Thanks for taking a look at this issue. Let me know if you need any more details.
I'm using 0.5.16 and find that an archive with a single folder is not preserved on extract. Instead its contents are dumped into the root. I have seen this on extract-zip package as well. I'm using this on windows
Activity
Scui1 commentedon Mar 17, 2021
I noticed the same, any update on this?
begin-again commentedon Jun 18, 2025
I'm using 0.5.16 and find that an archive with a single folder is not preserved on extract. Instead its contents are dumped into the root. I have seen this on extract-zip package as well. I'm using this on windows
Fixed extractEntryTo flattening subdirectories (#306)
cthackers commentedon Jul 10, 2026
fixed