4 ms·
One thing I was surprised to discover is that promisifyAll alters the original object - which is actually great for ES6 imports. So: import fs from 'fs';
by untog 11y ago
One thing I was surprised to discover is that promisifyAll alters the original object - which is actually great for ES6 imports. So:
import fs from 'fs';
Promise.promisifyAll(fs);
works great.
- altano 11y agoThat probably won't work when you switch from Babel=>ES5 to Babel=>ES6 (http://www.2ality.com/2015/07/es6-module-exports.html?m=1 http://www.2ality.com/2015/07/es6-module-exports.html?m=1) as ES6 bindings are immutable bindings to the actual values in the module instead of copies.