1.0.2 • Published 8 years ago

@eyecone/cb2prom v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

Node-style callback function to Promise


Install:

npm install @eyecone/util-cb2prom --save

Basic usage:

cb2prom(context, method, callback, ...args)

const cb2prom = require('@eyecone/cb2prom');

class WrapClass {
  constructor() {
      this.wrappedObject = new WrappedObject();
  }

  wrappedMethod(a, b, c, d, callback) {
    return cb2prom(this.wrappedObject, this.wrappedObject.someMethod, callback, a, b, c, d);
  }
}