node-archiver
node-archiver copied to clipboard
[Question] how can i send a zip buffer without having to write to the disc ?
I have a txt file, I need to compress it in a zip to send to s3. What I don't want is to burn that zip on the disk!
how can i create the zip to send without having to record?
did you figure it out.
aws sdk has a write stream api. i am sure, just pipe the readable stream to this writable stream, hence no need to write to /tmp
@carvalhoviniciusluiz it's in the doc:
// append a file from buffer
const buffer3 = Buffer.from('buff it!');
archive.append(buffer3, { name: 'file3.txt' });
I went with https://www.npmjs.com/package/client-zip which has real time streaming to zip (no compression)
@ricky11 looks like it's only for browser and not working in nodejs.