node-modules / compressing

Everything you need for compressing and uncompressing
MIT License
431 stars 36 forks source link

is it possible to zip a directory without including the parent directory as root? #8

Closed jhudson8 closed 1 year ago

jhudson8 commented 6 years ago

for example compressing.zip.compressDir('/foo/bar', 'foo.zip') will end up with

/bar/a.txt
/bar/b.txt

whereas I'd like to have

/a.txt
/b.txt

Thanks

wiliam-paradox commented 5 years ago

I think that at the time of writing this, it's resolved. I have seen in the code the next:

As third argument, pass ignoreBase as true.

compressing.zip.compressDir('/foo/bar/', 'foo.zip', {
    ignoreBase: true
});
davidkhala commented 4 years ago

It should be highlighted in document, definitely