I started to use bluebird instead of Q
Currently the code which I use is like following
runProcess = function(path) {
var result = Promise.defer();
fs.readFileAsync(path)
.then(function (Content) {
var parser = new parseFile(Content);
var adpt = parser.update();
result.resolve(adpt);
}, function(error) {
result.reject(error);
});
return result.promise;
}
My Question if there a better way to write it ?