Socket
Socket
Sign inDemoInstall

promise.prototype.finally

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise.prototype.finally

ES Proposal spec-compliant shim for Promise.prototype.finally


Version published
Weekly downloads
1.4M
increased by2.19%
Maintainers
2
Weekly downloads
 
Created

What is promise.prototype.finally?

The promise.prototype.finally package provides a polyfill for the `finally` method on the Promise prototype. This method allows for a callback to be executed when the promise is settled, regardless of its outcome (fulfilled or rejected). It is useful for running cleanup code or finalizing operations without caring about the promise's resolution.

What are promise.prototype.finally's main functionalities?

Adding finally support to Promises

This feature allows for the addition of the `finally` method to the Promise prototype, enabling cleanup or final operations to be run regardless of whether the promise was fulfilled or rejected.

require('promise.prototype.finally').shim();

new Promise((resolve, reject) => {
  // Asynchronous operation
}).finally(() => {
  // Cleanup or final code to run regardless of promise outcome
});

Other packages similar to promise.prototype.finally

Keywords

FAQs

Package last updated on 05 Feb 2024

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