mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
…
|
||
---|---|---|
.. | ||
test | ||
.npmignore | ||
.travis.yml | ||
index.js | ||
LICENSE | ||
package.json | ||
README.md |
util-promisify
Node 8's require('util').promisify
as a node module, so you can use it right now!
Supports all major node versions.
Usage
const promisify = require('util-promisify');
const fs = require('fs');
const stat = promisify(fs.stat);
stat('/tmp/').then(s => {
// ...
});
Installation
$ npm install util-promisify
API
See util.promisify
's API docs.
promisify(original)
(Symbol) promisify.custom
If available, the Symbol is reexported from node core's util
module.
License
MIT