{"_id":"native-or-another","_rev":"29-e6ddcfacad3734084fa8b274f3363b81","name":"native-or-another","description":"Guaranteed way for getting a Promise. Always native Promise if available, otherwise looks for common promise libraries and loads which is installed. Allows registering custom Promise implementation in node < 0.12 versions","dist-tags":{"latest":"5.0.1"},"versions":{"1.0.0":{"name":"native-or-another","version":"1.0.0","description":"Use either the native Promise or Micropromise (or another)","main":"index.js","scripts":{"lint":"npm install && ./node_modules/.bin/jshint ./*.js","test":"npm run lint && NODE_ENV=test ./node_modules/.bin/mocha","test-cov":"npm test && NODE_ENV=test node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha","test-travis":"npm test && NODE_ENV=test node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly"},"author":{"name":"Charlike Make Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"repository":{"type":"git","url":"git://github.com/tunnckoCore/native-or-another.git"},"keywords":["promise","promises","promises-aplus","micropromise","micro","Promises/A+"],"dependencies":{},"devDependencies":{"coveralls":"*","istanbul":"*","jshint":"*","mocha":">=2","micropromise":"~0.4.6","mocha-lcov-reporter":"*"},"licenses":[{"type":"MIT","url":"https://github.com/tunnckoCore/native-or-another/blob/master/license.md"}],"gitHead":"f533ed2df026e8956a745802d83d3500fdf95aaf","bugs":{"url":"https://github.com/tunnckoCore/native-or-another/issues"},"homepage":"https://github.com/tunnckoCore/native-or-another","_id":"native-or-another@1.0.0","_shasum":"e7c3c373e131886dd9fa461ce8cfdf7fb34997b2","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"e7c3c373e131886dd9fa461ce8cfdf7fb34997b2","tarball":"https://registry.npmjs.org/native-or-another/-/native-or-another-1.0.0.tgz","integrity":"sha512-j4PMgmrB+YJ8820sr1pJKqaqn8bzICQwcsN8hnMprSxN//cz7Cfl2dxMyfXRXldsTdTlKFCHsJ2FFOdVJT/bfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBcWbTF5EaMkC/LrmO2LvHDobStxSKoFLm4jEC9Vq8HNAiBjsxDK0wN1X0JpLub5SA+wwkVBgm+8E49TTcn7vCRozw=="}]},"directories":{}},"2.0.0":{"name":"native-or-another","version":"2.0.0","description":"Export either the native Promise or Bluebird (using native-or-bluebird) as deferred object.","scripts":{"lint":"jshint . && jscs . --reporter inline","test":"mocha","test-cov":"istanbul cover _mocha","test-travis":"istanbul cover _mocha --report lcovonly"},"author":{"name":"Charlike Make Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"repository":{"type":"git","url":"git://github.com/tunnckoCore/native-or-another.git"},"keywords":["aplus","bluebird","deferred","export","exports","native","object","promise","promises","promises-aplus"],"license":{"type":"MIT","url":"https://github.com/tunnckoCore/native-or-another/blob/master/license.md"},"dependencies":{"native-or-bluebird":"^1.1.2"},"devDependencies":{"bluebird":"^2.4.1","istanbul-harmony":"^0.3.1","mocha":"^2.0.1","mocha-lcov-reporter":"^0.0.1"},"gitHead":"77b664ca6c61db5ad0d2423444059c4d8628cd1e","bugs":{"url":"https://github.com/tunnckoCore/native-or-another/issues"},"homepage":"https://github.com/tunnckoCore/native-or-another","_id":"native-or-another@2.0.0","_shasum":"17a567f92beea9cd71acff96a7681a735eca3bff","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"17a567f92beea9cd71acff96a7681a735eca3bff","tarball":"https://registry.npmjs.org/native-or-another/-/native-or-another-2.0.0.tgz","integrity":"sha512-rDE50rrX/PSk2StV5EnwpRk35TENl4I4ZsSGZsMJufLdAJ1P4YzNwVf5UOhjQodwz+RdTP9eZSG7FiqnoY25nA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHMW9HWI7o2lqmCS03we1pi90jbA1A/hcwzHzLXRilHXAiAH7+ad0AcyxKRbo61xufl6R/1L+4lxBrvj3qLv2bsNRw=="}]},"directories":{}},"3.0.0":{"name":"native-or-another","version":"3.0.0","description":"Always will expose native `Promise` if available, otherwise `Bluebird` but only if you don't give another promise module like `q` or `promise` or what you want.","repository":{"type":"git","url":"git+https://github.com/tunnckocore/native-or-another.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://www.tunnckocore.tk"},"main":"index.js","license":"MIT","scripts":{"test":"standard && node test.js"},"dependencies":{"bluebird":"^2.10.1","native-promise":"^1.0.0"},"devDependencies":{"assertit":"^0.1.0","pinkie":"^1.0.0"},"files":["index.js"],"keywords":["always","always-promise","bluebird","custom","native","pinkie","promise"],"gitHead":"a07b08f7206ef6792d05fff275044850dea8154e","bugs":{"url":"https://github.com/tunnckocore/native-or-another/issues"},"homepage":"https://github.com/tunnckocore/native-or-another#readme","_id":"native-or-another@3.0.0","_shasum":"c3351715a87b8c169ba70175b88423c18d2a3115","_from":".","_npmVersion":"3.3.2","_nodeVersion":"4.0.0","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"dist":{"shasum":"c3351715a87b8c169ba70175b88423c18d2a3115","tarball":"https://registry.npmjs.org/native-or-another/-/native-or-another-3.0.0.tgz","integrity":"sha512-SadMGvps6r+L8lSRzNy/tkjb1aaI+r7zwtEbi1D8lZjfqwbQm7pAYzv5O4jOpGfExBOYFXrszwRtQ/uE9ujtoQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEUvix35f/CWPdT7wc+iU8WkXZw/Tec/hwieOvTJmX+UAiEA9CymwOl95+CNNcP9ZDtLBYbgK7np0WJpOELeNOawD4s="}]},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"directories":{}},"3.0.1":{"name":"native-or-another","version":"3.0.1","description":"Always will expose native `Promise` if available, otherwise `Bluebird` but only if you don't give another promise module like `q` or `promise` or what you want.","repository":{"type":"git","url":"git+https://github.com/tunnckocore/native-or-another.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://www.tunnckocore.tk"},"main":"index.js","license":"MIT","scripts":{"test":"standard && node test.js"},"dependencies":{"bluebird":"^2.10.1","native-promise":"^1.0.0"},"devDependencies":{"assertit":"^0.1.0","pinkie":"^1.0.0","semver":"^5.0.3"},"files":["index.js"],"keywords":["always","always-promise","bluebird","custom","native","pinkie","promise"],"gitHead":"38542bf9f91638f653af0c25cd00db9bd95708fc","bugs":{"url":"https://github.com/tunnckocore/native-or-another/issues"},"homepage":"https://github.com/tunnckocore/native-or-another#readme","_id":"native-or-another@3.0.1","_shasum":"5ec75df9df61bb3bde352889e6449e8c1a5167f3","_from":".","_npmVersion":"3.3.2","_nodeVersion":"4.0.0","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"dist":{"shasum":"5ec75df9df61bb3bde352889e6449e8c1a5167f3","tarball":"https://registry.npmjs.org/native-or-another/-/native-or-another-3.0.1.tgz","integrity":"sha512-4pCTNzK8BOrXYd6AxpahVYYJBiILmm+4di5D7Jc7zUjpw/SfdYZtV9Fpufzx68vA+NZRtTecHWZu9pUvfWONIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAvFP078f/zflodemeBU5YvOUWRB3JNuk0kqlzrtaipCAiEA9wnZQI8bPPBxMyBqFm8AikQA1C5IPUlptHYuMbBPbdw="}]},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"directories":{}},"3.0.2":{"name":"native-or-another","version":"3.0.2","description":"Always will expose native `Promise` if available, otherwise `Bluebird` but only if you don't give another promise module like `q` or `promise` or what you want.","repository":{"type":"git","url":"git+https://github.com/tunnckocore/native-or-another.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://www.tunnckocore.tk"},"main":"index.js","license":"MIT","scripts":{"test":"standard && node test.js"},"dependencies":{"bluebird":"^3.1.1","native-promise":"^1.0.0"},"devDependencies":{"assertit":"^0.1.0","pinkie":"^2.0.1","semver":"^5.0.3"},"files":["index.js"],"keywords":["always","always-promise","bluebird","custom","native","pinkie","promise"],"gitHead":"86265d6225df3e2e775c29d5f82321940ab3a07d","bugs":{"url":"https://github.com/tunnckocore/native-or-another/issues"},"homepage":"https://github.com/tunnckocore/native-or-another#readme","_id":"native-or-another@3.0.2","_shasum":"59334b1e3f8e41ba454ad05e9c5d1393ff356b3a","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.4.1","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"dist":{"shasum":"59334b1e3f8e41ba454ad05e9c5d1393ff356b3a","tarball":"https://registry.npmjs.org/native-or-another/-/native-or-another-3.0.2.tgz","integrity":"sha512-mRk/fV1GlGLU9gGBpywDphFG7cf+t/ZNiqidVeK09tYc7NHCeiQFj03XxlcNf+O8B7pIlcLhCVU7RcL89X/Y8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEbm1fbEBFHyFQDyDAPYkjhU8E6lnZljTalJbwHfEU5rAiEA1jvIZ1zodG+5LZFw2wuDJLxIdLTQuogltatEh8banKQ="}]},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"directories":{}},"4.0.0":{"name":"native-or-another","version":"4.0.0","description":"Always will expose native `Promise` if available, otherwise `Bluebird` but only if you don't give another promise module like `q` or `promise` or what you want.","repository":{"type":"git","url":"git+https://github.com/tunnckocore/native-or-another.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://www.tunnckocore.tk"},"main":"index.js","license":"MIT","scripts":{"test":"standard && node test.js"},"dependencies":{"native-promise":"^1.0.0"},"devDependencies":{"cross-spawn":"^4.0.0","mukla":"^0.4.4","pinkie":"^2.0.1","semver":"^5.0.3","spawn-sync":"^1.0.15"},"files":["index.js"],"keywords":["always","always-promise","bluebird","custom","native","pinkie","promise"],"gitHead":"89e2bea3abe7456ef3c0ae7b31daff0001f3148a","bugs":{"url":"https://github.com/tunnckocore/native-or-another/issues"},"homepage":"https://github.com/tunnckocore/native-or-another#readme","_id":"native-or-another@4.0.0","_shasum":"ea1e3804954e3984b9a765fb036dc52e3ecdfb46","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"dist":{"shasum":"ea1e3804954e3984b9a765fb036dc52e3ecdfb46","tarball":"https://registry.npmjs.org/native-or-another/-/native-or-another-4.0.0.tgz","integrity":"sha512-Nx251sJGdMe/dZLRgDMQuFKw5ZJf2J3oZ4LjUQrZBZJd4iZuo67eV2MU5kcol4y0gOV/vplhyuswaKaI9aU21A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDMaHdZK5SPuE4i/C//ZOddR47MixuUw4PwS6SpouiZAIgObCz4fhpRDy2QmK6dk7HULcv9pGt7MF1vpGmng9cy5U="}]},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/native-or-another-4.0.0.tgz_1472083726824_0.06939575797878206"},"directories":{}},"5.0.0":{"name":"native-or-another","version":"5.0.0","description":"Guaranteed way for getting a Promise. Always native Promise if available, otherwise looks for common promise libraries and loads which is installed. Allows registering custom Promise implementation in node < 0.12 versions","repository":{"type":"git","url":"git+https://github.com/tunnckocore/native-or-another.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"https://i.am.charlike.online"},"precommit.silent":true,"main":"index.js","license":"MIT","scripts":{"lint":"standard index.js test.js --fix --verbose","test":"npm-run-all -s lint test:*","test:api":"nyc --reporter lcov node test.js","test:report":"nyc report","prerelease":"npm test","release":"standard-version --sign --no-verify","git":"npm-run-all -s git:*","git:add":"git add --all","git:cz":"git-cz","commit":"npm-run-all -s test git"},"dependencies":{"extend-shallow":"^2.0.1","native-promise":"^1.0.1","semver":"^5.3.0","try-catch-callback":"^2.0.2"},"devDependencies":{"commitizen":"~2.7.0","cross-spawn":"^5.1.0","cz-conventional-changelog":"1.1.5","mukla":"^0.4.9","npm-run-all":"~3.1.2","nyc":"^10.1.2","pre-commit":"^1.2.2","spawn-sync":"^1.0.15","standard":"^9.0.0","standard-version":"^4.0.0"},"files":["index.js","register.js"],"keywords":["any","any-promise","autoload","bluebird","common","common-promise","ecma","ecmascript","es2015","es6","es2017","load","load-promise","loading","native","native-promise","promise","promises","register","register-promise","registration","specification"],"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"verb":{"run":true,"toc":{"render":true,"method":"preWrite","maxdepth":3},"layout":"empty","tasks":["readme"],"related":{"list":["try-catch-callback","native-promise","redolent","clean-stacktrace","stacktrace-metadata","find-callsite"],"highlight":"always-done"},"reflinks":["always-done","async-done","base","charlike","commitizen","dezalgo","once","standard-version","verb","verb-generate-readme","any-promise","native-promise","try-catch-core"],"lint":{"reflinks":true}},"gitHead":"3e2c18d073e7afe5f79c464b59930732e5762833","bugs":{"url":"https://github.com/tunnckocore/native-or-another/issues"},"homepage":"https://github.com/tunnckocore/native-or-another#readme","_id":"native-or-another@5.0.0","_shasum":"b153b0117116a8acffc9805588f8aec7290623fd","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.1","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"dist":{"shasum":"b153b0117116a8acffc9805588f8aec7290623fd","tarball":"https://registry.npmjs.org/native-or-another/-/native-or-another-5.0.0.tgz","integrity":"sha512-eRe9dUg5q3sxZZ4BBq5dt4EDL+50vtcwwJ7aquT00ob5Mo944IvDucbmDFt3sPwnluj8QPIqQ/IrHu2LVlHK6A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTVC51SmwK/sqiVMH1VrSeYBws8WlDEGTB80lHQyoIXgIhAJGjlMUfJQWpdqP/LGE5aWndYvEzy7pRqU8aL6pxGn5k"}]},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/native-or-another-5.0.0.tgz_1489715253889_0.595370423514396"},"directories":{}},"5.0.1":{"name":"native-or-another","version":"5.0.1","description":"Guaranteed way for getting a Promise. Always native Promise if available, otherwise looks for common promise libraries and loads which is installed. Allows registering custom Promise implementation in node < 0.12 versions","repository":{"type":"git","url":"git+https://github.com/tunnckocore/native-or-another.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"https://i.am.charlike.online"},"precommit.silent":true,"main":"index.js","license":"MIT","scripts":{"lint":"standard index.js test.js --fix --verbose","test":"npm-run-all -s lint test:*","test:api":"nyc --reporter lcov node test.js","test:report":"nyc report","prerelease":"npm test","release":"standard-version --sign --no-verify","git":"npm-run-all -s git:*","git:add":"git add --all","git:cz":"git-cz","commit":"npm-run-all -s test git"},"dependencies":{"extend-shallow":"^2.0.1","native-promise":"^1.0.1","semver":"^5.3.0","try-catch-callback":"^2.0.2"},"devDependencies":{"commitizen":"~2.7.0","cross-spawn":"^5.1.0","cz-conventional-changelog":"1.1.5","mukla":"^0.4.9","npm-run-all":"~3.1.2","nyc":"^10.1.2","pre-commit":"^1.2.2","spawn-sync":"^1.0.15","standard":"^9.0.0","standard-version":"^4.0.0"},"files":["index.js","register.js"],"keywords":["any","any-promise","autoload","bluebird","common","common-promise","ecma","ecmascript","es2015","es6","es2017","load","load-promise","loading","native","native-promise","promise","promises","register","register-promise","registration","specification"],"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"verb":{"run":true,"toc":{"render":true,"method":"preWrite","maxdepth":3},"layout":"empty","tasks":["readme"],"related":{"list":["try-catch-callback","native-promise","redolent","clean-stacktrace","stacktrace-metadata","find-callsite"],"highlight":"always-done"},"reflinks":["always-done","async-done","base","charlike","commitizen","dezalgo","once","standard-version","verb","verb-generate-readme","any-promise","native-promise","try-catch-core"],"lint":{"reflinks":true}},"gitHead":"c57ccd76352df851251d095c856362a75498a1b3","bugs":{"url":"https://github.com/tunnckocore/native-or-another/issues"},"homepage":"https://github.com/tunnckocore/native-or-another#readme","_id":"native-or-another@5.0.1","_shasum":"be5c182dd11958e23674a4a6d09653429cec11ab","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.1","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"dist":{"shasum":"be5c182dd11958e23674a4a6d09653429cec11ab","tarball":"https://registry.npmjs.org/native-or-another/-/native-or-another-5.0.1.tgz","integrity":"sha512-n1nodPbFJzo7DsMBmppEEEdMq2aXKA3GwUWfg+ffb+ZON/DYTt2N/Dj4wtGyTwGeD2VtXvRQ96C7wLhOsYEntA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpolOS9Vfk8z17t1lXUEk/Rj90Yk65l8IR30U4rX7oxQIhALQy13MF2QKRvatPlcA97QNCI5qkI3igBrh+gkAW5BMv"}]},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/native-or-another-5.0.1.tgz_1489716333361_0.5661039447877556"},"directories":{}}},"readme":"# native-or-another [![NPM version](https://img.shields.io/npm/v/native-or-another.svg?style=flat)](https://www.npmjs.com/package/native-or-another) [![mit license][license-img]][license-url] [![NPM monthly downloads](https://img.shields.io/npm/dm/native-or-another.svg?style=flat)](https://npmjs.org/package/native-or-another) [![npm total downloads][downloads-img]][downloads-url]\n\n> Guaranteed way for getting a Promise. Always native Promise if available, otherwise looks for common promise libraries and loads which is installed. Allows registering custom Promise implementation in node < 0.12 versions\n\n[![code climate][codeclimate-img]][codeclimate-url] \n[![code style][standard-img]][standard-url] \n[![linux build][travis-img]][travis-url] \n[![windows build][appveyor-img]][appveyor-url] \n[![code coverage][coverage-img]][coverage-url] \n[![dependency status][david-img]][david-url]\n[![paypal donate][paypalme-img]][paypalme-url] \n\n_Pretty much like [any-promise][], but works a bit different & better._\n\n> Let your library support any ES 2015 (ES6) compatible Promise and leave the \nchoice to application authors. The application can optionally register its preferred \nPromise implementation and it will be exported when requiring any-promise from library code.\n–– [any-promise][]\n\nIf no preference is registered, always defaults to native Promise,\nusing [native-promise][] detection. It defaults to global Promise for \nnewer Node.js `>= 0.12` versions. The browser version defaults \nto the window Promise, so polyfill or register as necessary.\n\n## Table of Contents\n- [Install](#install)\n- [Usage](#usage)\n  * [Get a Promise, always](#get-a-promise-always)\n  * [Custom Promise registration](#custom-promise-registration)\n  * [Support for old Node.js versions](#support-for-old-nodejs-versions)\n- [Related](#related)\n- [Contributing](#contributing)\n- [Building docs](#building-docs)\n- [Running tests](#running-tests)\n- [Author](#author)\n- [License](#license)\n\n_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_\n\n## Install\nInstall with [npm](https://www.npmjs.com/)\n\n```\n$ npm install native-or-another --save\n```\n\nor install using [yarn](https://yarnpkg.com)\n\n```\n$ yarn add native-or-another\n```\n\n## Usage\n> For more use-cases see the [tests](test.js). \n\nExamples assumes that they are ran in older node versions, meaning `< 0.12`, be aware of that!\n\n### Get a Promise, always\n\nUse it as any other Promise. It will give you native Promise always, \nuntil node < 0.12 - in that case it will try to load one of the [common promise libraries](./register.js#L15-L26), \notherwise it will throw with a useful message to signal your users to install \nsome of these promise implementations or `register` other one. \n\n```js\nconst Promise = require('native-or-another')\n\nconst promise = new Promise((resolve, reject) => {\n  resolve(123)\n})\n\npromise.then((res) => console.log('foo:', res))\n```\n\n### Custom Promise registration\n\nYou can `.register()` a custom Promise which will be used by the main export.\nThat function also returns that Promise. If no arguments are passed, it will try to load some\nof the common promise libraries, again.\n\n```js\nconst register = require('native-or-another/register')\n\nconst MyCustomPromise = () => 444\nregister({ Promise: MyCustomPromise })\n\nconst Promize = require('native-or-another')\n\n// loads `MyCustomPromise`\nconst res = Promize()\nconsole.log(res) // => 444\n\n// but also adds it to global scope\nconst res = Promise()\nconsole.log(res) // => 444\n\n// but also adds it to global.Promise\nconst res = global.Promise()\nconsole.log(res) // => 444\n```\n\nNotice that it adds the promise to global scope and `global`, if you don't want that behaviour\nyou should disable it through passing an option to `.register` function, like `{ global: false }`.\n\n```js\nconst register = require('native-or-another/register')\nconst Promize = register({ global: false })\n\nconsole.log(Promize) // => function\nconsole.log(Promise) // => undefined\nconsole.log(global.Promise) // => undefined\n```\n\nThis is exactly how `require('native-or-another')` works!\n\n### Support for old Node.js versions\n\nNode.js versions prior to `v0.12` may have contained buggy versions of the global `Promise`. \nFor this reason, the global `Promise` is not loaded automatically for these old versions.  \nIf using `native-or-another` in Node.js versions `< v0.12`, the user should register a \ndesired implementation.\n\nIf an implementation is not registered, `native-or-another` will attempt to discover \nan installed `Promise` implementation.  If no implementation can be found, an error \nwill be thrown on `require('native-or-another')`.  While the auto-discovery usually avoids errors, \nit is non-deterministic. It is recommended that the user always register a preferred \nimplementation for older Node.js versions.\n\nThis auto-discovery is only available for Node.js versions before `v0.12`. \nAny newer versions (includeing `v0.12`) will always default to the global `Promise` implementation.\n\n> Adapted from the [any-promise][] readme.\n\n## Related\n- [clean-stacktrace](https://www.npmjs.com/package/clean-stacktrace): Clean up error stack traces from node internals | [homepage](https://github.com/tunnckocore/clean-stacktrace#readme \"Clean up error stack traces from node internals\")\n- [find-callsite](https://www.npmjs.com/package/find-callsite): Finds the correct place where the stack trace was started, not the place where error was thrown | [homepage](https://github.com/tunnckocore/find-callsite#readme \"Finds the correct place where the stack trace was started, not the place where error was thrown\")\n- [native-promise](https://www.npmjs.com/package/native-promise): Get native `Promise` or falsey value if not available. | [homepage](https://github.com/tunnckocore/native-promise#readme \"Get native `Promise` or falsey value if not available.\")\n- [redolent](https://www.npmjs.com/package/redolent): Simple promisify with sane defaults, works on node 0.10 if you provide custom Promise through options | [homepage](https://github.com/hybridables/redolent#readme \"Simple promisify with sane defaults, works on node 0.10 if you provide custom Promise through options\")\n- [stacktrace-metadata](https://www.npmjs.com/package/stacktrace-metadata): Modify given `err` object to be more useful - adds `at`, `line`, `column`, `place` and `filename` properties… [more](https://github.com/tunnckocore/stacktrace-metadata#readme) | [homepage](https://github.com/tunnckocore/stacktrace-metadata#readme \"Modify given `err` object to be more useful - adds `at`, `line`, `column`, `place` and `filename` properties and also cleans stack traces.\")\n- [try-catch-callback](https://www.npmjs.com/package/try-catch-callback): try/catch block with a callback, used in [try-catch-core][]. Use it when you don't care about asyncness so… [more](https://github.com/hybridables/try-catch-callback#readme) | [homepage](https://github.com/hybridables/try-catch-callback#readme \"try/catch block with a callback, used in [try-catch-core][]. Use it when you don't care about asyncness so much and don't want guarantees. If you care use [try-catch-core][].\")\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/native-or-another/issues/new).  \nPlease read the [contributing guidelines](CONTRIBUTING.md) for advice on opening issues, pull requests, and coding standards.  \nIf you need some help and can spent some cash, feel free to [contact me at CodeMentor.io](https://www.codementor.io/tunnckocore?utm_source=github&utm_medium=button&utm_term=tunnckocore&utm_campaign=github) too.\n\n**In short:** If you want to contribute to that project, please follow these things\n\n1. Please DO NOT edit [README.md](README.md), [CHANGELOG.md](CHANGELOG.md) and [.verb.md](.verb.md) files. See [\"Building docs\"](#building-docs) section.\n2. Ensure anything is okey by installing the dependencies and run the tests. See [\"Running tests\"](#running-tests) section.\n3. Always use `npm run commit` to commit changes instead of `git commit`, because it is interactive and user-friendly. It uses [commitizen][] behind the scenes, which follows Conventional Changelog idealogy.\n4. Do NOT bump the version in package.json. For that we use `npm run release`, which is [standard-version][] and follows Conventional Changelog idealogy.\n\nThanks a lot! :)\n\n## Building docs\nDocumentation and that readme is generated using [verb-generate-readme][], which is a [verb][] generator, so you need to install both of them and then run `verb` command like that\n\n```\n$ npm install verbose/verb#dev verb-generate-readme --global && verb\n```\n\n_Please don't edit the README directly. Any changes to the readme must be made in [.verb.md](.verb.md)._\n\n## Running tests\nClone repository and run the following in that cloned directory\n\n```\n$ npm install && npm test\n```\n\n## Author\n**Charlike Mike Reagent**\n\n+ [github/tunnckoCore](https://github.com/tunnckoCore)\n+ [twitter/tunnckoCore](https://twitter.com/tunnckoCore)\n+ [codementor/tunnckoCore](https://codementor.io/tunnckoCore)\n\n## License\nCopyright © 2014, 2017, [Charlike Mike Reagent](https://i.am.charlike.online). Released under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 17, 2017._  \n_Project scaffolded using [charlike][] cli._\n\n[always-done]: https://github.com/hybridables/always-done\n[any-promise]: http://github.com/kevinbeaty/any-promise\n[async-done]: https://github.com/gulpjs/async-done\n[base]: https://github.com/node-base/base\n[charlike]: https://github.com/tunnckocore/charlike\n[commitizen]: https://github.com/commitizen/cz-cli\n[dezalgo]: https://github.com/npm/dezalgo\n[native-promise]: https://github.com/tunnckocore/native-promise\n[once]: https://github.com/isaacs/once\n[standard-version]: https://github.com/conventional-changelog/standard-version\n[try-catch-core]: https://github.com/hybridables/try-catch-core\n[verb-generate-readme]: https://github.com/verbose/verb-generate-readme\n[verb]: https://github.com/verbose/verb\n\n[license-url]: https://www.npmjs.com/package/native-or-another\n[license-img]: https://img.shields.io/npm/l/native-or-another.svg\n\n[downloads-url]: https://www.npmjs.com/package/native-or-another\n[downloads-img]: https://img.shields.io/npm/dt/native-or-another.svg\n\n[codeclimate-url]: https://codeclimate.com/github/tunnckoCore/native-or-another\n[codeclimate-img]: https://img.shields.io/codeclimate/github/tunnckoCore/native-or-another.svg\n\n[travis-url]: https://travis-ci.org/tunnckoCore/native-or-another\n[travis-img]: https://img.shields.io/travis/tunnckoCore/native-or-another/master.svg?label=linux\n\n[appveyor-url]: https://ci.appveyor.com/project/tunnckoCore/native-or-another\n[appveyor-img]: https://img.shields.io/appveyor/ci/tunnckoCore/native-or-another/master.svg?label=windows\n\n[coverage-url]: https://codecov.io/gh/tunnckoCore/native-or-another\n[coverage-img]: https://img.shields.io/codecov/c/github/tunnckoCore/native-or-another/master.svg\n\n[david-url]: https://david-dm.org/tunnckoCore/native-or-another\n[david-img]: https://img.shields.io/david/tunnckoCore/native-or-another.svg\n\n[standard-url]: https://github.com/feross/standard\n[standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n\n[paypalme-url]: https://www.paypal.me/tunnckoCore\n[paypalme-img]: https://img.shields.io/badge/paypal-donate-brightgreen.svg\n\n","maintainers":[{"email":"super.ludiq@gmail.com","name":"vanchoy"},{"email":"mameto2011@gmail.com","name":"tunnckocore"}],"time":{"modified":"2022-06-20T20:51:05.272Z","created":"2014-10-28T16:02:27.417Z","1.0.0":"2014-10-28T16:02:27.417Z","2.0.0":"2014-12-21T02:44:49.077Z","3.0.0":"2015-09-29T01:09:29.702Z","3.0.1":"2015-09-29T02:05:39.771Z","3.0.2":"2016-01-13T16:38:31.540Z","4.0.0":"2016-08-25T00:08:49.529Z","5.0.0":"2017-03-17T01:47:35.872Z","5.0.1":"2017-03-17T02:05:35.516Z"},"homepage":"https://github.com/tunnckocore/native-or-another#readme","keywords":["any","any-promise","autoload","bluebird","common","common-promise","ecma","ecmascript","es2015","es6","es2017","load","load-promise","loading","native","native-promise","promise","promises","register","register-promise","registration","specification"],"repository":{"type":"git","url":"git+https://github.com/tunnckocore/native-or-another.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"https://i.am.charlike.online"},"bugs":{"url":"https://github.com/tunnckocore/native-or-another/issues"},"readmeFilename":"README.md","license":"MIT"}