npm.io
0.0.4 • Published 9 years ago

@nathanfaucett/promise_polyfill

Licence
MIT
Version
0.0.4
Deps
8
Vulns
0
Weekly
0

Promise

Promise polyfill for the browser and node.js

var Promise = require("@nathanfaucett/promise_polyfill");


new Promise(function resolver(resolve, reject) {
    if (value) {
        resolve(true);
    } else {
        reject(false);
    }
}).then(
    function success(value) {
        return value;
    },
    function error(value) {
        return value;
    }
);

Keywords