{
  "_id": "p-finally",
  "maintainers": [
    {
      "name": "sindresorhus",
      "email": "sindresorhus@gmail.com"
    }
  ],
  "keywords": [
    "promise",
    "finally",
    "handler",
    "function",
    "async",
    "await",
    "promises",
    "settled",
    "ponyfill",
    "polyfill",
    "shim",
    "bluebird"
  ],
  "dist-tags": {
    "latest": "3.0.0"
  },
  "author": {
    "name": "Sindre Sorhus",
    "email": "sindresorhus@gmail.com",
    "url": "https://sindresorhus.com"
  },
  "_rev": "10-01f3c77475901d859bda39cc656f0c63",
  "description": "`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome",
  "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",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/sindresorhus/p-finally.git"
  },
  "users": {
    "rocket0191": true,
    "sopepos": 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": "https://archive.ito.gov.ir/npm/_packages/p-finally/-/p-finally-1.0.0.tgz",
        "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCIE82KcJe5EKCinYh0326F2tFW8tpEbRpsNFtI0Alrr72AiBKW7Fa0Z0Fc/p03b+9HuPnYAVscEeDFOlOuuoyg/fpMQ=="
          }
        ]
      },
      "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": {}
    },
    "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": {
        "integrity": "sha512-Hh1x1SR9/Y5ndrziFD+dfB0N+chocV4uCmyzqshjN7fXj4kReUt5Fx+I50Eg9uUWml7g5gCYUzEHiselmnP3dg==",
        "shasum": "b5bfd254f48358184552430fe55e968a83ccf593",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/p-finally/-/p-finally-2.0.0.tgz",
        "fileCount": 4,
        "unpackedSize": 2918,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7TxiCRA9TVsSAnZWagAAgMMP/R1+5JDq/rkvgdz67B4H\n0TTqgsu62jBFY15DCBlbUhOQY6D5IPgnmqXFtV2K8r39HmujB/Zui7CPvJnG\nj2Cw/nJSMGo1jSK6CST1uvEUe/5wqM2JV0RTs/115+pOrmQ59GtCpkECaDaJ\nBn68aOHeO66PjVVPznco+PTD2M53gOR0ufykta5Ws1i10GEO6o410x6DVGfG\nh9V51sE4As9ZOBjx1F81aelSgxbLQJoprgJtrTFq8IpMBdKfaHWHxEF4JS0T\nWoV1XJSliaoqaEYuR/8qulUgCrtaxZzW/uA37eNK7jyQkt/NA6SLay4l/Rsx\nwWfYsAI6AeupRdnfFQiWoV8b0/SvxBCpg9ILB6hNBgi/DZFSv+4jykxRnhh1\n29f+DcuUaYIMg+9bkHvK9WpaVPxPJqPeyQUCzWZkJZTjFq6T9UGLYKWTn0Y/\nALDAwjilbLSxAYVaAc7QoxbSbBPAin3Dil49Hu5R6Pvlt5jS6wYSDg+P7p03\nhjJIowjExuuCABqTAVeZKJyniMXnE3npJBukzmH20Qb3tOHTRv7LI6UIRw+X\nfw3+ZP1FfnD1eezeWqlz1WixNfl7mAyF2qlPDhdbz1DnOm+gZRToxt8KERIo\nJ5F5fLu9EXMQ82jOvTwzoRgKPj7CUf8hwjyoxZQWe/EzRWJ9nPNBat/SNdky\nhrNL\r\n=Eahz\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEYCIQDCTZMtqyZ7+vUboTyNCb5D/2dwGeVJ7zPvKijM7kzmUAIhAP9aflvEJ5dUFOYqL7efbch3jeP02sGa4hJ+e5QLxGab"
          }
        ]
      },
      "maintainers": [
        {
          "name": "sindresorhus",
          "email": "sindresorhus@gmail.com"
        }
      ],
      "directories": {},
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/p-finally_2.0.0_1559051362108_0.403046563273898"
      },
      "_hasShrinkwrap": false
    },
    "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": {
        "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==",
        "shasum": "bd6fcaa9c559a096b680806f4d657b3f0f240561",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/p-finally/-/p-finally-2.0.1.tgz",
        "fileCount": 4,
        "unpackedSize": 3365,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCktbCRA9TVsSAnZWagAAtGsP/RYSaSrL0IN++15KWg94\n/YbsIRGhldWhp0xGAorpxNIe/tiNP+SiXZtfBmRQ9Z/hGlsJEOdtgAL/4Qkq\ncjl9amsLWBLT5K92bibMml1X0hod3SQg/uijdAZT4qIIegIOJG/qeQ65ihqS\nfgc8t76Gt+65sL4jVxyK7LIY+4i9/rJ8MPiuk1exx7BsjKYrEyDeFFBh+8az\n0eoywev2QHADntMq9qc7jFq2eMqTOlc3x+FNJGantlsNms/fBBeLGw6hQ/l/\njexcnvmqxsIwO1744zadSK2Zlkt1TPgKJXVDyL4OtsdztllRXG0H03dEcatF\n+rA+NygqFFZxhxRAOFNlnEDiAqYitfX7BVa3qpj1xMf5vBriTSpbdXBK46hb\nM0c8ahr0+hl42ir8scke+5D0P5bTTNVVMdSsl+xDOVq/j+JJpHetBeralLI/\nkGfzyg/qCEc8/XzHpW14TnYhiUdPtpCGbfYMFyj3N+UR7160zvZio/3CvvRQ\nIEIEa9dzULjDYgIDYlqgk7Rb2dn6p829F28Wz+hm70Sj0A3UwCTqDWSnLISi\nOdLexyKy5IwTS2T2prYqstTYBYYs5spD3m2EBVytisvxsj6PycCzgzoEgoZO\n/zkStqy1Ot4jEkA5vYDHavB9mQ1+LO786GabdBWCTEcOtTnARkY76Jy+VLbi\n3ebo\r\n=gIn0\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIHQHeRYwa7yIAEk0HkChgqCjFFwbjJEtsZWz5omfwfi+AiEA2OtCsH8V6SbYFahdTao6bnWe8om4EH86NeIen0/Lzek="
          }
        ]
      },
      "maintainers": [
        {
          "name": "sindresorhus",
          "email": "sindresorhus@gmail.com"
        }
      ],
      "directories": {},
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/p-finally_2.0.1_1560955738325_0.1225840138005696"
      },
      "_hasShrinkwrap": false
    },
    "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": {
        "integrity": "sha512-zvzo4d4xg+IQiZTakibWdwAh+LDYqM/iJO18lwtWbMyDOnOBIWY+AMDvOrP4eQshuCKXRi9R9CTXWFh4R0wOEw==",
        "shasum": "9f094842ed5c89c2088d783d7cdc644bdc49345a",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/p-finally/-/p-finally-3.0.0.tgz",
        "fileCount": 4,
        "unpackedSize": 3320,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgb+lPCRA9TVsSAnZWagAAbxsP/3eEPTSOtOFD484AtLC0\n0NOwprjWsU/4MEqUE3QmjoGYOXw4WauMinKgML0PPsPF7CoX8fS4KC5Lf568\nwOY1NgcpjV48HgeaqEk7cc0lMWYJdt3V9IQ0VL6SmsR7+9ED6jnSon/6yxyh\npwFvcnM/WydtPqNdCVJXwd3WYaYulcp7fa/CVViQQfd90Qs4a2bQX5rkq4EC\n6kz9ucMpJdu3rWOck/VWz+1EfnQAtkvxdvw6SEjdlOqThcUgA7ev4qVS6xWD\nYkyudwgK9MbX4psC3+Jnjk0GyZvbhyqQzarSi6EOK5EbiNL3mrJqVClk2RAT\n+Md2GKOq7TlNQ/4ZnIY9l8Ox+jy1VCox+r3HSdmUQ3l07oPz0SBQdHy0DRqz\nrhoTASsS6DBXA9hdpQSs2hh8savcrvr4VavvjTjE0UElO9enDjf35zvSet08\n0Ue73E25ZQxk4raxMTKaq3tflVu2WKxXw/DfIejIYsACSCwEt5oK2J5Hn+l/\nkVNpH97oNROlRWm163/QTJH5OYUtfRSGMCTlE03ErF0BP6MQTio2oQIuNcBS\nyG4MseAtqA8ZVqhyAhK+v1m62eI7L36m+8xQoULvd0p/el4de8z2+kW2mDdj\nDzPB3ANl5fafzCFwKTYpb5u9NZ08X2Osf/h4kDyv5gZOfIn1gG7xsQxeJxXz\nRUGU\r\n=U67H\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCIBcbzgt0YVM3nTN7u4ZOyJOfHP7OrGCwy0rnLx7hUZVcAiASEdeUnqDzzoghCQ91KQJvSahHw49ySHH5KN2N1KqvKw=="
          }
        ]
      },
      "directories": {},
      "maintainers": [
        {
          "name": "sindresorhus",
          "email": "sindresorhus@gmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/p-finally_3.0.0_1617946958932_0.3693581226691287"
      },
      "_hasShrinkwrap": false,
      "deprecated": "Deprecated"
    }
  },
  "name": "p-finally",
  "time": {
    "modified": "2026-05-23T07:11:26.100Z",
    "created": "2016-10-21T06:02:09.848Z",
    "1.0.0": "2016-10-21T06:02:09.848Z",
    "2.0.0": "2019-05-28T13:49:22.238Z",
    "2.0.1": "2019-06-19T14:48:58.457Z",
    "3.0.0": "2021-04-09T05:42:39.138Z"
  },
  "readmeFilename": "readme.md",
  "homepage": "https://github.com/sindresorhus/p-finally#readme"
}