Skip to content

Instantly share code, notes, and snippets.

@pllearns
Created May 1, 2017 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pllearns/c1db69d55fe127be643cc6de9d15ce03 to your computer and use it in GitHub Desktop.
Save pllearns/c1db69d55fe127be643cc6de9d15ce03 to your computer and use it in GitHub Desktop.
Solution to http.collect ----> learnyounode http.collect
'use strict'
var http = require('http')
var bl = require('bl')
http.get(process.argv[2], function(response) {
response.pipe(bl(function(err, data) {
if (err) {
console.error(err)
}
data = data.toString()
console.log(data.length)
console.log(data)
}))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment