title: return values with async function in nodejs
body: <p>I have this function:</p>
  
  <pre><code>exports.readPartial = function(html, values, response) {
    fs.readFile(__dirname + "/../html/partials/" + html, function(error, file) {
    if(error) { this.loadError(response, error); }
    else {
     console.log("\t--&gt; partial found: " + file);
     return file; // FILE VALUE
    }
    });
  }
  </code></pre>
  
  <p>When that function is called it should return the value of "file". However, when calling <code>return file;</code> im actually returning the value in the anonymous function I passed as an argument.
  What is the right way to return this value on async programming with nodejs? 
  Using <code>var that = this;</code> ?</p>
  
  <p>Got confused pretty confused with this style of programming.</p>