promise.ify

promiseify / promisify / promise-ify / pify

Usage no npm install needed!

<script type="module">
  import promiseIfy from 'https://cdn.skypack.dev/promise.ify';
</script>

README

promise.ify

promiseify / promisify / promise-ify / pify

Build Status Coverage Status npm version npm downloads npm license

Note

this is target ES5 environment.

Install

$ npm i promise.ify --save

API

promiseify

  • promiseify(m, ctx)
    • m: the input
    • ctx: the context
  • promiseify.all(o)
    • o: the input object
var promiseify = require('promise.ify')
var readFile = promiseify(fs.readFile, fs)

var Connection = require('mysql/lib/Connection')
promiseify.all(Connection.prototype)

promiseify.noerr

take care of the callback(result) case

  • promiseify.noerr(m, ctx)
    • m: the input method
    • ctx: the context
  • promiseify.noerr.all(o)
    • o: the input object

Why

for split things out of bluebird

Changelog

CHANGELOG.md

See Also

License

the MIT License http://magicdawn.mit-license.org