JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16771
  • Score
    100M100P100Q130464F
  • License MIT

Converts whatever standard NodeJS callback function into ES6 standard promise.

Package Exports

  • cb2promise

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 (cb2promise) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cb2promise

Last version Dependency status Dev Dependencies Status NPM Status Donate

Converts whatever standard NodeJS callback function into ES6 standard promise.

Install

npm install cb2promise --save

If you want to use in the browser (powered by Browserify):

bower install cb2promise --save

and later link in your HTML:

<script src="bower_components/cb2promise/dist/cb2promise.js"></script>

Usage

var cb2promise = require('cb2promise');

var sampleFunction = function(done) {
  return done(null, 'hello world');
};

var promise = cb2promise(sampleFunction)

promise().then(console.log);
// => hello world

License

MIT © Kiko Beats