{"_id":"p-finally","_rev":"19333","name":"p-finally","description":"`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T09:59:49.000Z","created":"2016-10-21T06:02:09.848Z","3.0.0":"2021-04-09T05:42:39.138Z","2.0.1":"2019-06-19T14:48:58.457Z","2.0.0":"2019-05-28T13:49:22.238Z","1.0.0":"2016-10-21T06:02:09.848Z"},"users":{"rocket0191":true,"sopepos":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-finally.git"},"versions":{"3.0.0":{"name":"p-finally","version":"3.0.0","description":"`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-finally.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava"},"keywords":["promise","finally","handler","function","async","await","promises","settled","ponyfill","polyfill","shim","bluebird"],"devDependencies":{"ava":"^3.15.0","xo":"^0.38.2"},"gitHead":"b8eb23a4415e988f2c346bcda74efb7dd3ab8e17","bugs":{"url":"https://github.com/sindresorhus/p-finally/issues"},"homepage":"https://github.com/sindresorhus/p-finally#readme","_id":"p-finally@3.0.0","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"9f094842ed5c89c2088d783d7cdc644bdc49345a","size":1896,"noattachment":false,"key":"/p-finally/-/p-finally-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-finally/download/p-finally-3.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-finally_3.0.0_1617946958932_0.3693581226691287"},"_hasShrinkwrap":false,"publish_time":1617946959138,"deprecated":"Deprecated","_cnpm_publish_time":1617946959138},"2.0.1":{"name":"p-finally","version":"2.0.1","description":"`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-finally.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava"},"keywords":["promise","finally","handler","function","async","await","promises","settled","ponyfill","polyfill","shim","bluebird"],"devDependencies":{"ava":"^1.4.1","xo":"^0.24.0"},"gitHead":"b73e204c7670a8f01428a8c220bcd337d395bdf6","bugs":{"url":"https://github.com/sindresorhus/p-finally/issues"},"homepage":"https://github.com/sindresorhus/p-finally#readme","_id":"p-finally@2.0.1","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"bd6fcaa9c559a096b680806f4d657b3f0f240561","size":1909,"noattachment":false,"key":"/p-finally/-/p-finally-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-finally/download/p-finally-2.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-finally_2.0.1_1560955738325_0.1225840138005696"},"_hasShrinkwrap":false,"publish_time":1560955738457,"_cnpm_publish_time":1560955738457},"2.0.0":{"name":"p-finally","version":"2.0.0","description":"`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-finally.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava"},"keywords":["promise","finally","handler","function","async","await","promises","settled","ponyfill","polyfill","shim","bluebird"],"devDependencies":{"ava":"^1.4.1","xo":"^0.24.0"},"gitHead":"7ae963410de1754b565d2fd2b4ef581fef099bd3","bugs":{"url":"https://github.com/sindresorhus/p-finally/issues"},"homepage":"https://github.com/sindresorhus/p-finally#readme","_id":"p-finally@2.0.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b5bfd254f48358184552430fe55e968a83ccf593","size":1669,"noattachment":false,"key":"/p-finally/-/p-finally-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-finally/download/p-finally-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-finally_2.0.0_1559051362108_0.403046563273898"},"_hasShrinkwrap":false,"publish_time":1559051362238,"_cnpm_publish_time":1559051362238},"1.0.0":{"name":"p-finally","version":"1.0.0","description":"`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-finally.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","finally","handler","function","async","await","promises","settled","ponyfill","polyfill","shim","bluebird"],"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"9cfdd5dccb41995300916c17ab0fab784800f4d3","bugs":{"url":"https://github.com/sindresorhus/p-finally/issues"},"homepage":"https://github.com/sindresorhus/p-finally#readme","_id":"p-finally@1.0.0","_shasum":"3fbcfb15b899a44123b34b6dcc18b724336a2cae","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"3fbcfb15b899a44123b34b6dcc18b724336a2cae","size":1754,"noattachment":false,"key":"/p-finally/-/p-finally-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-finally/download/p-finally-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/p-finally-1.0.0.tgz_1477029729610_0.2481102051679045"},"directories":{},"publish_time":1477029729848,"_cnpm_publish_time":1477029729848,"_hasShrinkwrap":false}},"readme":"# p-finally\n\n> [`Promise#finally()`](https://github.com/tc39/proposal-promise-finally) [ponyfill](https://ponyfill.com) - Invoked when the promise is settled regardless of outcome\n\nUseful for cleanup.\n\n## Install\n\n```\n$ npm install p-finally\n```\n\n## Usage\n\n```js\nimport pFinally from 'p-finally';\n\nconst directory = createTempDirectory();\n\nawait pFinally(write(directory), () => {\n\tcleanup(directory);\n});\n```\n\n## API\n\n### pFinally(promise, onFinally?)\n\nReturns a `Promise`.\n\n#### onFinally\n\nType: `Function`\n\nNote: Throwing or returning a rejected promise will reject `promise` with the rejection reason.\n\n## Related\n\n- [p-try](https://github.com/sindresorhus/p-try) - `Promise.try()` ponyfill - Starts a promise chain\n- [More…](https://github.com/sindresorhus/promise-fun)\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-p-finally?utm_source=npm-p-finally&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","_attachments":{},"homepage":"https://github.com/sindresorhus/p-finally#readme","bugs":{"url":"https://github.com/sindresorhus/p-finally/issues"},"license":"MIT"}