I\'m hacking on a Node program that uses smtp-protocol to capture SMTP emails and act on the mail data. The library provides the mail data as a stream, and I don\'t know how
I had more luck using like that :
let string = ''; readstream .on('data', (buf) => string += buf.toString()) .on('end', () => console.log(string));
I use node v9.11.1 and the readstream is the response from a http.get callback.
v9.11.1
readstream
http.get