3 ms·
It seems to me that Node should ship promisify-ed versions of all these functions (e.g. fs.readFileAsync). Over time they could replace the implementation with
by mastax 9y ago
It seems to me that Node should ship promisify-ed versions of all these functions (e.g. fs.readFileAsync). Over time they could replace the implementation with ones that use the OS Async APIs, though perhaps this step is unnecessary if you're already using an event loop underneath.
- lhnz 9y agoUntil then you can use `mz` for a modernised API[0]. [0] https://github.com/normalize/mz https://github.com/normalize/mz
- NoInkling 9y agoI mean, they've been debating about how to add a promisified API for years (see for example https://github.com/nodejs/node/pull/5020 https://github.com/nodejs/node/pull/5020) but nothing has come of it. util.promisify is a welcome addition, but very late for a first step.
- abalashov 9y agoHow incredibly uncanny. Just yesterday morning, I posted this question! https://stackoverflow.com/questions/44260289/using-native-es6-promises-to-de-nodeify-compact-standard-callbacks https://stackoverflow.com/questions/44260289/using-native-es...