|
%!s(int64=2) %!d(string=hai) anos | |
---|---|---|
.. | ||
test | %!s(int64=2) %!d(string=hai) anos | |
.npmignore | %!s(int64=2) %!d(string=hai) anos | |
.travis.yml | %!s(int64=2) %!d(string=hai) anos | |
LICENSE | %!s(int64=2) %!d(string=hai) anos | |
README.md | %!s(int64=2) %!d(string=hai) anos | |
index.js | %!s(int64=2) %!d(string=hai) anos | |
package.json | %!s(int64=2) %!d(string=hai) anos |
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