Closed realtebo closed 4 years ago
I see that using this code I can output stream to video
onData(stream, session, callback) { stream.pipe(process.stdout); // print message to console stream.on("end", callback); }
But, how can I SAVE received stream? How can I capture all the stream into a variable, for example?
You need to parse the stream You can use SimpleParser.
https://github.com/nodemailer/mailparser
onData(stream, session, callback) { simpleParser(stream, (err, parsed) => { // store }); }
I see that using this code I can output stream to video
But, how can I SAVE received stream? How can I capture all the stream into a variable, for example?