Comparing version
@@ -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 [](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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Yes
NaN3320
-1.34%14
-6.67%1
Infinity%53
-11.67%