any-pify

2.0.0 • Public • Published

any-pify

Greenkeeper badge

Simply pify pre-loaded with any-promise.

Usage

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);
});

API

pify(input, [options])

Returns a promise wrapped version of the supplied function or module.

The promiseModule option from pify is not present here. It is passed the value resolved from any-promise. The options argument is passed directly to pify.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    15
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    15
  • 1.0.0
    0

Package Sidebar

Install

npm i any-pify

Weekly Downloads

15

Version

2.0.0

License

MIT

Last publish

Collaborators

  • knpwrs