Socket
Socket
Sign inDemoInstall

@ungap/promise-all-settled

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ungap/promise-all-settled

A cross platform Promise.allSettled polyfill


Version published
Weekly downloads
1.4M
decreased by-6.44%
Maintainers
1
Weekly downloads
 
Created

What is @ungap/promise-all-settled?

The @ungap/promise-all-settled npm package is a polyfill for the Promise.allSettled method, which is a part of the ECMAScript 2020 specification. This method returns a promise that resolves after all of the given promises have either fulfilled or rejected, with an array of objects that each describe the outcome of each promise.

What are @ungap/promise-all-settled's main functionalities?

Polyfill for Promise.allSettled

This code demonstrates how to use the @ungap/promise-all-settled package to polyfill the Promise.allSettled method. It shows an array of promises, some of which resolve and one that rejects. Promise.allSettled is used to handle all the promises, and the results are logged to the console.

require('@ungap/promise-all-settled');

const promises = [
  Promise.resolve(33),
  new Promise(resolve => setTimeout(() => resolve(66), 0)),
  99,
  Promise.reject(new Error('an error'))
];

Promise.allSettled(promises).then(results => console.log(results));

Other packages similar to @ungap/promise-all-settled

Keywords

FAQs

Package last updated on 21 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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