Package Exports
- standard-as-callback
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (standard-as-callback) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Standard asCallback
A performant and standard (Bluebird) library that registers a node-style callback on a promise.
Install
$ npm install standard-as-callback
Usage
const asCallback = require('standard-as-callback')
const promise = new Promise(function (resolve) {
setTimeout(function () {
resolve('hello world!')
}, 1000)
})
asCallback(promise, function callback (err, res) {
console.log(err, res) // null, 'hello world!'
})
Thanks
Most code of this library are ported from the awesome Bluebird library.
License
The MIT License.