I'm new to backend with nodejs. most recently on a project I chose to unzip the zip file received from API in memory to work with it. But now i think about whether this is resource-saving. I would therefore like to ask the experienced nodejs developers, how long does the zip file stored in memory actually stay in memory? As long as the server is running or until the function ends?
I used the Zip-Tool adm-zip.
code-snippet
function getJsonFiles () {
const zipReportsFile = await fetch(this.generateApiUrl({action:"get",project:project.name,compression:"zip",date:myDate}));
const zipReportsFileBuffer = Buffer.from(await zipReportsFile.arrayBuffer());
//reading zip archive in memory
const zipContent = new AdmZip(zipReportsFileBuffer);
const jsonFiles = zipContent.getEntries();
return jsonFiles;
}
every answer is appreciate.