standard-as-callback
A performant and standard (Bluebird) library that registers a node-style callback on a promise
Last updated 7 years ago by luin .
MIT · Repository · Bugs · Original npm
$ cnpm install standard-as-callback 
SYNC missed versions from official npm registry.

Standard asCallback

A performant and standard (Bluebird) library that registers a node-style callback on a promise.

Build Status

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.

Current Tags

  • 2.1.0                                ...           latest (4 years ago)

2 Versions

  • 2.1.0                                ...           4 years ago
  • 2.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (4)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org