$ npm install native-promise
Get native
Promiseor falsey value if not available.
npm i native-promise --save
For more use-cases see the tests
var NativePromise = require('native-promise')
if (NativePromise) {
var promise = NativePromise.resolve(123)
promise.then(function (res) {
console.log(res) //=> 123
})
} else {
console.log(NativePromise) //=> false
}
Promise if available, otherwise Bluebird but only if you don't give another promise module like q or promise or what you want.Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.
© 2010 - cnpmjs.org x YWFE | Home | YWFE