4.2.8 • Published 5 years ago

es6-promise v4.2.8

Weekly downloads
10,622,719
License
MIT
Repository
github
Last release
5 years ago

ES6-Promise (subset of rsvp.js) Build Status

This is a polyfill of the ES6 Promise. The implementation is a subset of rsvp.js extracted by @jakearchibald, if you're wanting extra features and more debugging options, check out the full library.

For API details and how to use promises, see the JavaScript Promises HTML5Rocks article.

Downloads

CDN

To use via a CDN include this in your html:

<!-- Automatically provides/replaces `Promise` if missing or broken. -->
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.js"></script>
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script> 

<!-- Minified version of `es6-promise-auto` below. -->
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script> 

Node.js

To install:

yarn add es6-promise

or

npm install es6-promise

To use:

var Promise = require('es6-promise').Promise;

Usage in IE<9

catch and finally are reserved keywords in IE<9, meaning promise.catch(func) or promise.finally(func) throw a syntax error. To work around this, you can use a string to access the property as shown in the following example.

However most minifiers will automatically fix this for you, making the resulting code safe for old browsers and production:

promise['catch'](function(err) {
  // ...
});
promise['finally'](function() {
  // ...
});

Auto-polyfill

To polyfill the global environment (either in Node or in the browser via CommonJS) use the following code snippet:

require('es6-promise').polyfill();

Alternatively

require('es6-promise/auto');

Notice that we don't assign the result of polyfill() to any variable. The polyfill() method will patch the global environment (in this case to the Promise name) when called.

Building & Testing

You will need to have PhantomJS installed globally in order to run the tests.

npm install -g phantomjs

  • npm run build to build
  • npm test to run tests
  • npm start to run a build watcher, and webserver to test
  • npm run test:server for a testem test runner and watching builder
whipperynrcc-mobilebank-jssdk@cargos/sprintpay_frontend_core_apivue-template-mfrontplate-network@backx/bundler@sheerid/jslib-nightlycsaclientcoveo-search-uidota2_web_api@omnia/tooling-vue@theia/core@cocreate/uppyqb-im-webqb-web-imreact-form-generator-validation-reactstrap-availity-testsmart-sdkbigby-trackermis-potal-navigationpadlockskilli8n-react-native-fast-imagethomas-express-http-proxysewertronicsmini-next-ssropensheetmusicdisplay-userremain-package@elk/json@elk/rest-clientonquerysmt-form-builder@plarin/build-configs@plarintest/build-configsrequestguardcwemailercwsmserrornotifieradamgering-stably-sdkstably-sdkzozengo-reactarisenid-core-testarisenidjs-trial-version2-corearisenidjs-version-two-corebeyond-diskusageusimple-jstheme-chalk-previewsportstalk-js@geodashboard/gd-core__old@geodashboard/gd-gltg__old@authdog/lock-coresprintpay_paymentmethodsfrontendany-fetch-retry@zzappie/bigchaindb-driverappsynth-koa-better-http-proxyadamstably-stably-sdkcirkleapilibitem-validatorfaster-remote-config--sdk-jssunny-singlecomponents@cognitive3d/cognitive3d-analyticsbmoran-react-mui-mapbox-geocoderemsyscustomer-analytics-packagebt-bosp-combravobimkuknos-sdk@udacity/auth-servicesdops-client-sharedbarcode-lovebox@cashremit/cr-streamline-iconsrcdl-assetsscm-uiroyalcanin-webdesignlanguage-assetsflvsskmaeppic-server@synapsestudios/securecomzhubajiehungtv12345bambuser-cdn-client-jswps-driver-reactgonation-site-generatorzdt-intuit-authvue-custom-fullcalendarvue-fullcalendar-customvue-fullcalendar-custom-01@pure-function/jsutilsreact-form-generator-validation-reactstrap-availityreact-form-generator-validation-reactstrap-availity2csw-aas-js1hkvideo-player-flv@brudi/brudi-toolbox-nextauto-too-clibloodhound-with-request-headers-support-jssome-sqlskyweb-revisedcover-map-business@daysmart/frankenstack-cli@incta/feeder-lambdaesysplashfrankenstack-appsync-clientfrankenstack-cli
4.2.8

5 years ago

4.2.7

5 years ago

4.2.6

5 years ago

4.2.5

6 years ago

4.2.4

6 years ago

4.2.3

6 years ago

4.2.2

6 years ago

4.2.1

6 years ago

4.2.0

6 years ago

4.1.1

7 years ago

4.1.0

7 years ago

4.0.5

7 years ago

4.0.4

7 years ago

4.0.3

8 years ago

4.0.2

8 years ago

4.0.1

8 years ago

4.0.0

8 years ago

3.3.1

8 years ago

3.3.0

8 years ago

3.2.1

8 years ago

3.1.2

8 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.3.0

9 years ago

2.2.0

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago