New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

p-finally

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p-finally - npm Package Compare versions

Comparing version

to
3.0.0

8

index.js

@@ -1,7 +0,5 @@

'use strict';
module.exports = async (
export default async function pFinally(
promise,
onFinally = (() => {})
) => {
) {
let value;

@@ -17,2 +15,2 @@ try {

return value;
};
}
{
"name": "p-finally",
"version": "2.0.1",
"version": "3.0.0",
"description": "`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome",
"license": "MIT",
"repository": "sindresorhus/p-finally",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=8"
"node": ">=12"
},

@@ -36,5 +39,5 @@ "scripts": {

"devDependencies": {
"ava": "^1.4.1",
"xo": "^0.24.0"
"ava": "^3.15.0",
"xo": "^0.38.2"
}
}

@@ -1,2 +0,2 @@

# p-finally [![Build Status](https://travis-ci.org/sindresorhus/p-finally.svg?branch=master)](https://travis-ci.org/sindresorhus/p-finally)
# p-finally

@@ -7,3 +7,2 @@ > [`Promise#finally()`](https://github.com/tc39/proposal-promise-finally) [ponyfill](https://ponyfill.com) - Invoked when the promise is settled regardless of outcome

## Install

@@ -15,18 +14,14 @@

## Usage
```js
const pFinally = require('p-finally');
import pFinally from 'p-finally';
const directory = createTempDirectory();
(async () => {
await pFinally(write(directory), () => {
cleanup(directory);
});
await pFinally(write(directory), () => {
cleanup(directory);
});
```
## API

@@ -44,3 +39,2 @@

## Related

@@ -51,3 +45,2 @@

---

@@ -54,0 +47,0 @@

Sorry, the diff of this file is not supported yet