Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

promise-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-polyfill - npm Package Compare versions

Comparing version 3.1.0 to 4.0.1

.eslintrc.js

18

package.json
{
"name": "promise-polyfill",
"version": "3.1.0",
"version": "4.0.1",
"description": "Lightweight promise polyfill. A+ compliant",
"main": "Promise.js",
"scripts": {
"test": "./node_modules/.bin/promises-aplus-tests tests/adapter.js && JASMINE_CONFIG_PATH=jasmine.json ./node_modules/jasmine/bin/jasmine.js;"
"test": "eslint promise.js && mocha && karma start --single-run",
"build": "uglifyjs --compress --mangle -o promise.min.js -- promise.js "
},

@@ -20,6 +21,11 @@ "repository": {

"devDependencies": {
"grunt": "^0.4.4",
"grunt-contrib-uglify": "^0.4.0",
"jasmine": "^2.3.1",
"promises-aplus-tests": "*"
"eslint": "^2.4.0",
"karma": "^0.13.19",
"karma-browserify": "^4.4.2",
"karma-chrome-launcher": "^0.2.2",
"karma-mocha": "^0.2.1",
"mocha": "^2.3.4",
"promises-aplus-tests": "*",
"sinon": "^1.17.2",
"uglify-js": "^2.6.2"
},

@@ -26,0 +32,0 @@ "keywords": [

@@ -5,3 +5,3 @@ <a href="http://promises-aplus.github.com/promises-spec">

</a>
# Promise
# Promise
[![travis][travis-image]][travis-url]

@@ -55,8 +55,25 @@

```
## Performance
By default promise-polyfill uses `setImmediate`, but falls back to `setTimeout` for executing asynchronously. If a browser does not support `setImmediate`, you may see performance issues.
By default promise-polyfill uses `setImmediate`, but falls back to `setTimeout` for executing asynchronously. If a browser does not support `setImmediate` (IE/Edge are the only browsers with setImmediate), you may see performance issues.
Use a `setImmediate` polyfill to fix this issue. [setAsap](https://github.com/taylorhakes/setAsap) or [setImmediate](https://github.com/YuzuJS/setImmediate) work well.
If you polyfill `window.setImmediate` or use `Promise._setImmediateFn(immedateFn)` it will be used instead of `window.setTimeout`
```
npm install setasap --save
```
```js
var Promise = require('promise-polyfill');
var setAsap = require('setasap');
Promise._setImmedateFn(setAsap);
```
## Unhandled Rejections
promise-polyfill will warn you about possibly unhandled rejections. It will show a console warning if a Promise is rejected, but no `.catch` is used. You can turn off this behavior by setting `Promise._setUnhandledRejectionFn(<rejectError>)`.
If you would like to disable unhandled rejections. Use a noop like below.
```js
Promise._setUnhandledRejectionFn(function(rejectError) {});
```
## Testing

@@ -63,0 +80,0 @@ ```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc