Q: Promisify Synchronous operations for chaining promises?
问题 Is there any merit in promisifying synchronous operations so that by design they can be chained in onSuccess or onError callbacks? Eg: function loadSettings(path) { if (fs.existsSync(path)) { return Q(fsJson.loadSync(path)); } return new Q.defer().reject('No local settings!'); } doingSomethingFirst() .then(loadSettings, obtainSettings) .then(doSomethingWithSettings) .done() What's best? 回答1: No, moreover, it gives the false impression that these methods are async so you or other developers