I'm still trying to get the hang of this, but this is confusing for me. So I use http.get and a pipe with the bl module, I want it to change content so I can use it outside the function doesn't work why? I thought with var it would be global within my file and that would allow me to change it.
var http = require('http');
var bl = require('bl');
var url1 = process.argv[2];
var content;
http.get(url1, function(response){
response.pipe(bl(function(err,data){
return data.toString();
}));
});
console.log(content.length);
console.log(content);