ZJONSSON/node-unzipper

README needs an example of how to handle directories

ianengelbrecht opened this issue · 1 comments

If we get a directory while iterating over zip file entries, i.e. entry.type == 'Directory', how do we then handle each entry in that directory. It has to be with recursion, right? Do we need to pipe the directory to another unzipper.Parse() instance? How do we know when we're got a file out of that directory?

You don't need to handle Directory. I mean, you could go ahead and create the directory if you want or simply ignore it. All files within directories are going to have the directory in the filename.

In the native extract method, we used to ignore directories, but in the latest release we create them even if they end up being empty (v0.12.1)