I'm using node-archiver to archive folder "export" with photos inside.
Everything works ok but inside archive I got folder 'offers' and photos are in this folder.
I would like to have like a "flat" .zip, so when I'll unpack my .zip it unpack photos without that 'offers' folder.
My code:
const folderPath = '/export/.';
const output = fs.createWriteStream('test/offers.zip');
const archive = archiver('zip');
archive.pipe(output);
archive.directory(folderPath, false);
archive.finalize();
What I'm getting after unpacking:
What I would like to get:
How can I achieve this?
Regards, Gemmi
All you need is set prefix via options property. Like this
Regards, Lukas