{"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"keywords":["promise","finally","handler","function","async","await","promises","settled","ponyfill","polyfill","shim","bluebird"],"dist-tags":{"latest":"1.0.0"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"description":"`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome","readme":"# p-finally [![Build Status](https://travis-ci.org/sindresorhus/p-finally.svg?branch=master)](https://travis-ci.org/sindresorhus/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\n## Install\n\n```\n$ npm install --save p-finally\n```\n\n\n## Usage\n\n```js\nconst pFinally = require('p-finally');\n\nconst dir = createTempDir();\n\npFinally(write(dir), () => cleanup(dir));\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\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## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-finally.git"},"users":{"rocket0191":true},"bugs":{"url":"https://github.com/sindresorhus/p-finally/issues"},"license":"MIT","versions":{"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","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/p-finally/-/p-finally-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/p-finally-1.0.0.tgz_1477029729610_0.2481102051679045"},"directories":{}}},"name":"p-finally","time":{"modified":"2017-03-05T11:51:22.511Z","created":"2016-10-21T06:02:09.848Z","1.0.0":"2016-10-21T06:02:09.848Z"},"readmeFilename":"readme.md","homepage":"https://github.com/sindresorhus/p-finally#readme"}