proxied-promise-object

wrap an object's callback methods with promise returning ones

npm install proxied-promise-object
26 downloads in the last month

proxied-promise-object

Proxy all calls to an objects functions to a wrapper which returns promises.

NOTE: This does not use "real" proxies (ES6)

Usage

var Proxy = require('proxied-promise-object');

// Proxy(Promise, object); also works
var fs = new Proxy(YourFavPromiseLib, require('fs'));

fs.stat('xfoo/...').then(
  function() {
  }
);

Proxies are stamped as well to protect wrapping proxies with proxies

var fs = new Proxy(YourFavPromiseLib, require('fs'));
var fs2 = new Proxy(YourFavPromiseLib, fs);

// fs === fs2
npm loves you