compress a file with folder structure to tgz
Posted: Tue Feb 22, 2022 11:30 am
I need to compress the incoming file (.png) to .tgz and it needs to be in a specific directory like "/folder1/folder2/myfile.png".
I found this npm module https://www.npmjs.com/package/compressing
So the incoming file will be a single file in the format of .png.
Maybe I can create a tmp folder with this file in it then compress it and send that tmp folder as new job?
What would be the fastest most reliable way?
I tried some with pump https://www.npmjs.com/package/pump. Pump the reading stream into the compress filestream and pass that to the write stream but could'nt get it to work yet.
Any suggestions?
I found this npm module https://www.npmjs.com/package/compressing
So the incoming file will be a single file in the format of .png.
Maybe I can create a tmp folder with this file in it then compress it and send that tmp folder as new job?
What would be the fastest most reliable way?
I tried some with pump https://www.npmjs.com/package/pump. Pump the reading stream into the compress filestream and pass that to the write stream but could'nt get it to work yet.
Any suggestions?