pipe function in Node and http.get
<p>I am learning node under workshops from <a href="http://nodeschool.io" rel="noreferrer">nodeschool</a>. name of workshop is 
learnyounode, question number 8. <strong>HTTP COLLECT</strong>.<br><br>Question was: 
  <em>Write a program that performs an HTTP GET request to a URL provided to you
  as the first command-line argument. Collect all data from the server (not
  just the first "data" event) and then write two lines to the console
  (stdout).
  The first line you write should just be an integer representing the number
  of characters received from the server. The second line should contain the
  complete String of characters sent by the server.</em>
<br><br>The answer i submitted was as follows.</p>

<pre><code>var http = require('http');
var url = process.argv[2];
http.get(url,function(res){
    var body = '';
    res.on('error',function(err){
        console.error(err);
    })
    res.on('data',function(chunk){
        body+=chunk.toString();
    });
    res.on('end',function(){
        console.log(body.length);
        console.log(body);
    });
});
</code></pre>

<p>while the answer they provided was,</p>

<pre><code>var http = require('http')
var bl = require('bl')
http.get(process.argv[2], function (response) {
  response.pipe(bl(function (err, data) {
    if (err)
      return console.error(err)
    data = data.toString()
    console.log(data.length)
    console.log(data)
  }))
})
</code></pre>

<p><br>
I would like to know the difference between these two codes. 
and please explain how http.get() and pipe works ...</p>