A wrapper to use pify with any-promise.
npm install any-pify
Simply [pify] pre-loaded with [any-promise].
``js
const pify = require('any-pify');
const fs = require('fs');
// Promisify a single function
pify(fs.readFile)('package.json', 'utf8').then(data => {
console.log(JSON.parse(data).name);
});
// Or promisify all methods in a module
pify(fs).readFile('package.json', 'utf8').then(data => {
console.log(JSON.parse(data).name);
});
`
Returns a promise wrapped version of the supplied function or module.
The [promiseModule] option from [pify] is not present here. It is passedany-promise
the value resolved from []. The [options] argument is passedpify
directly to [].
MIT
[any-promise]: https://github.com/kevinbeaty/any-promise "any-promise"options
[]: https://github.com/sindresorhus/pify#options "pify options"pify
[]: https://github.com/sindresorhus/pify "pify"promiseModule`]: https://github.com/sindresorhus/pify#promisemodule "pify promiseModule"
[