I have got stream and I need to get stream content into string. I stream from internet using http.get. I also write stream into file, but I don't want to write file and after that open the same file and read from it... So I need to convert stream into string Thanks for all advices...
var http = require('http');
var string = '';
var request = http.get("http://www.google.cz", function(response) {
response.on('data', function(response){
string += response.toString();
});
response.on('end', function(string){
console.log(string);
});
});
This works for sure. I am using it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With