$ npm install util-promisify
Node 8's require('util').promisify
as a node module, so you can use it right now!
Supports all major node versions.
const promisify = require('util-promisify');
const fs = require('fs');
const stat = promisify(fs.stat);
stat('/tmp/').then(s => {
// ...
});
$ npm install util-promisify
See util.promisify
's API docs.
If available, the Symbol is reexported from node core's util
module.
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE