Itty bitty little widdle twinkie pinkie ES2015 Promise implementation
There are tons of Promise implementations out there, but all of them focus on browser compatibility and are often bloated with functionality.
This module is an exact Promise specification polyfill (like native-promise-only), but in Node.js land (it should be browserify-able though).
$ npm install --save pinkie
var fs = require('fs');
var Promise = require('pinkie');
new Promise(function (resolve, reject) {
fs.readFile('foo.json', 'utf8', function (err, data) {
if (err) {
reject(err);
return;
}
resolve(data);
});
});
//=> Promise
pinkie
exports bare ES2015 Promise implementation and polyfills Node.js rejection events. In case you forgot:
Returns new instance of Promise
.
Required
Type: function
Function with two arguments resolve