I'm building a Node package that needs to download some files given the url. However, I don't want to save them into the filesystem directly. Instead, I need them to be preprocessed before saving into disk. Thus, I want to save the file content in a Buffer. How can this be acomplished with pipe() ?
Offcourse I could save a temp file and then open the file, process it and save the result but this brings unnecessary reads/writes into disk.
The files have generally small size and are .txt or .zip files so saving them in memory doesn't bring any harm.
One of the objectives is to find and extract only the pretended file when the downloaded file is a .zip . Using Adm-Zip I can do this, but have to pass a Buffer.
Thak You beforehand.