node-archiver icon indicating copy to clipboard operation
node-archiver copied to clipboard

[Question] how can i send a zip buffer without having to write to the disc ?

Open carvalhoviniciusluiz opened this issue 5 years ago • 4 comments

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?

carvalhoviniciusluiz avatar Mar 19 '20 00:03 carvalhoviniciusluiz

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

ricky11 avatar May 11 '20 12:05 ricky11

@carvalhoviniciusluiz it's in the doc:

// append a file from buffer
const buffer3 = Buffer.from('buff it!');
archive.append(buffer3, { name: 'file3.txt' });

jalik avatar Jul 08 '21 22:07 jalik

I went with https://www.npmjs.com/package/client-zip which has real time streaming to zip (no compression)

ricky11 avatar Jul 09 '21 04:07 ricky11

@ricky11 looks like it's only for browser and not working in nodejs.

jalik avatar Jul 09 '21 22:07 jalik