cgrinaldi
6/14/2015 - 11:18 PM

An example of properly using promises (no deferred!)

An example of properly using promises (no deferred!)

var getConfig = function() {
  var readFile = Q.nfbind(fs.readFile);
  return readFile(CONFIG_DIR + '/aFile.conf', 'utf-8').then(function(data) {
    var configJSON = helpers.configStr2JSON(data, true);
    return configJSON;
  });
};