[native-promise][author-www-url] [![npmjs.com][npmjs-img]][npmjs-url] [![The MIT License][license-img]][license-url]
September 29, 2015 ยท View on GitHub
Get native
Promiseor falsey value if not available.
Install
npm i native-promise --save
Usage
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
}
Related
- always-done: Handles completion and errors of anything!
- always-promise: Promisify basically everything.
- native-or-another: Always will expose native
Promiseif available, otherwiseBluebirdbut only if you don't give another promise module likeqorpromiseor what you want. - redolent: Simple promisify a callback-style function with sane defaults.
Contributing
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.