For when your promise libraries
promisifymethod just won't cut it!
Promises are awesome, but sometimes you need to use API's that just do not support them.
Most promise libraries provide a
promisify method to convert API's that take node style callback,
but they do not work in every situation.
promise-shim helps fill the gap.
$ npm install --save promise-shim
// You need to provide a Promise implementation:var promiseShim = PromiseConstructor;// or if global.Promise is already a valid promise constructor:var promiseShim = ;var promise =;
You can pass arguments to your function. Really helpful when using bind:
var myService = promiseShim;// myService is now a reusable function that returns a promise:;
Note: Always check your Promise libraries options for "promisification", you will only need
promise-shim in specific instances.
MIT © James Talmage