I have simple question - Can I get the Buffer from fs.createWriteStream()?
In my case I use archiver NPM module which may create archives from Buffer. When this module end work with method archive.finalize() I may get result from archive.pipe(stream). I want have Buffer from fs.createWriteStream() which I may send to res.send() Express method.
let archive = archiver("zip", {
zlib: { level: 9 } // Sets the compression level.
});
const stream = fs.createWriteStream(
"./src/backend/api/test.zip"
);
archive.pipe(stream);
archive.append(buffer, { name: "test.csv" });
archive.finalize();
If I understood your problem correctly, that might help you