title: Why doesn't request.on() work in Node.js
body: <p>I'm trying to get some data from a third party service using the node request module and return this data as string from a function. My perception was that <code>request()</code> returns a readable stream since you can do <code>request(...).pipe(writeableStream)</code> which - I thought - implies that I can do </p>
  
  <pre><code>function getData(){
      var string;
  
      request('someurl')
          .on('data', function(data){
               string += data;
          })
          .on('end', function(){
              return string;
          });
  }
  </code></pre>
  
  <p>but this does not really work. I think I have some wrong perception of how request() or node streams really work. Can somebody clear up my confusion here?</p>