title: Code stops execution abruptly when trying to print a string
body: <p>Whenever I try to print the string, the execution halts and exits the program.</p>
  
  <pre><code>var config = require('../config.json');
  var upacConfig = config.upac;
  
  var endpoint = upacConfig.endpoint;
  var customer = upacConfig.customer;
  var port = upacConfig.port;
  
  const http = require('http');
  const util = require('util');
  
  module.exports.getAll = function getAll(cb) {
    var url = "/" + upacConfig.methods.all + "?customer=" + customer;
    console.log(url);
    http.request({
      host: endpoint,
      path: url,
      port: port
    }, function(resp) {
      let s = '';
      // console.log('response');
      // var lines = 0;
      resp.on('data', function(d){
        s += d.toString();
        // console.log(++lines);
      })
      .on('end', function(){
        console.log(typeof s);
        console.log('length:', s.length);
        console.log(s); //  &lt;-- problem! lines below are not executed...
        console.log('length:', s.length);
        cb(null, s);
      })
    })
    .on('error', e =&gt; {
      console.log('Err:', e);
    })
    .end();
  };
  </code></pre>
  
  <p>Node version: 7.1.0</p>
  
  <p>All that the code outputs is the follows:</p>
  
  <pre><code>/api/v1/all?customer=foo
  string
  length: 323416
  </code></pre>
  
  <p>Edit: for an MVE do the following:</p>
  
  <p>Here is a simple server which serves a text file that the same number of characters mentioned above. (Mine was JSON string that long...).</p>
  
  <pre><code>const http = require('http');
  const fs = require('fs');
  const path = require('path');
  var file = path.join(__dirname,'json.txt')
  
  var app = http.createServer(function(req, res) {
    fs.createReadStream(file).pipe(res);
  });
  
  app.listen(3000);
  </code></pre>
  
  <p>Here is a test client that cosumes what the aboves serves.</p>
  
  <pre><code>const http = require('http');
  
  http.request('http://localhost:3000/', r =&gt; {
    var s = '';
    r.on('data', d =&gt; s+= d)
      .on('end', () =&gt; {
        console.log('length:', s.length);
        console.log(s);
      });
  }).end();
  </code></pre>