Gathering detailed insights and metrics for es6-promise
Gathering detailed insights and metrics for es6-promise
Gathering detailed insights and metrics for es6-promise
Gathering detailed insights and metrics for es6-promise
npm install es6-promise
99.5
Supply Chain
99.4
Quality
78.3
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
7,291 Stars
684 Commits
594 Forks
132 Watching
5 Branches
78 Contributors
Updated on 26 Nov 2024
JavaScript (99.32%)
HTML (0.68%)
Cumulative downloads
Total Downloads
Last day
-9.8%
1,877,850
Compared to previous day
Last week
1.8%
11,188,010
Compared to previous week
Last month
12.8%
46,015,479
Compared to previous month
Last year
-2.7%
473,018,150
Compared to previous year
24
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.
Promise
if missing or broken.es6-promise-auto
above.To use via a CDN include this in your html:
1<!-- Automatically provides/replaces `Promise` if missing or broken. --> 2<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.js"></script> 3<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script> 4 5<!-- Minified version of `es6-promise-auto` below. --> 6<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.min.js"></script> 7<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script> 8
To install:
1yarn add es6-promise
or
1npm install es6-promise
To use:
1var Promise = require('es6-promise').Promise;
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:
1promise['catch'](function(err) { 2 // ... 3});
1promise['finally'](function() { 2 // ... 3});
To polyfill the global environment (either in Node or in the browser via CommonJS) use the following code snippet:
1require('es6-promise').polyfill();
Alternatively
1require('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.
You will need to have PhantomJS installed globally in order to run the tests.
npm install -g phantomjs
npm run build
to buildnpm test
to run testsnpm start
to run a build watcher, and webserver to testnpm run test:server
for a testem test runner and watching builderNo vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/21 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
112 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More