4 ms·
5 Reasons Why You Should Be Using Promises
- vnglst 10y agoNice writeup, thanks for sharing! I think .then((path) => { return fs.readFileAsync(path) }) should be written as.then(fs.readFileAsync). Wrapping a function in an anonymous function doesn't really add anything - even with nice arrow notation ;-). Dr. Boolean wrote a nice piece on this practice in Javascript: https://drboolean.gitbooks.io/mostly-adequate-guide/content/ch2.html#a-quick-review https://drboolean.gitbooks.io/mostly-adequate-guide/content/...