Promisify Node-style asynchronous functions by putting a
.promise after them (or after the object for methods).
If you use this library then if you put
.promise after a Node-style
asynchronous function, it will turn it into a function that returns a promise
instead of taking a callback.
;;let p = fsreadFile;p;
The original function is available as a property on the promise-generating function (
If you want to promisify methods, use
.promise after the object and before the method name.
;;let p = fspromise;p;
Non-enumerable properties like class methods are now promisified.
Functions with names that would cause syntax errors (like
default) are supported.
___instapromiseOriginalFunction___ property is now non-enumerable so it doesn't show up when serializing functions whose
promise property has been accessed before.
Promise polyfill is no longer provided. 1.x provided a polyfill for environments without a native
Promise implementation, but in general, most environments you'll use now provide
This code is based on the proxying code used in fibrous.