title: Why is fs.readFile returning a buffer?
body: <p>I have referred to <a href="https://stackoverflow.com/questions/10058814/get-data-from-fs-readfile">this question</a> already. That is, I don't believe my problem lies in a misunderstanding of async. </p>
  
  <p>Here is the relevant part of my module. </p>
  
  <pre><code>var fs = require('fs');
  var q = require('q');
  var u = require('../utils/json');
  
  var indexFile = './data/index.json';
  
  function getIndex() {
      var def = q.defer(),
          promise = def.promise,
          obj;
  
      fs.readFile(indexFile, function(err,data) {
          if (err) {
              throw err;
              def.reject(err);
          }
          console.log('data', data);
  
          def.resolve(obj);
      });
  
      return promise;
  }
  </code></pre>
  
  <p>When I log 'data', I'm getting a buffer (below), rather than the JSON content of that file. </p>
  
  <pre><code>&lt;Buffer 5b 7b 22 68 65 6c 6c 6f 22 3a 22 77 6f 72 6c 64 22 7d 5d&gt;
  </code></pre>
  
  <p>Any thoughts on why?</p>