{"name":"@octokit/plugin-retry","version":"8.0.3","author":{"url":"http://github.com/SGrondin","name":"Simon Grondin"},"license":"MIT","_id":"@octokit/plugin-retry@8.0.3","maintainers":[{"name":"octokitbot","email":"security+octokitbot@github.com"}],"homepage":"https://github.com/octokit/plugin-retry.js#readme","bugs":{"url":"https://github.com/octokit/plugin-retry.js/issues"},"dist":{"shasum":"8b7af9700272df724d12fd6333ead98961d135c6","tarball":"http://registry-npm.ywwl.com/@octokit/plugin-retry/download/@octokit/plugin-retry-8.0.3.tgz","fileCount":13,"integrity":"sha512-vKGx1i3MC0za53IzYBSBXcrhmd+daQDzuZfYDd52X5S0M2otf3kVZTVP8bLA3EkU0lTvd1WEC2OlNNa4G+dohA==","signatures":[{"sig":"MEUCIDBTumyJbe95yeYSvxaxbNHqtoEV5cOCWAm1eRk2hW+RAiEAxyIQvm8SJppH0ujwXP+6+yD/0L/ERKQjRlbBKsRGjJY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@octokit%2fplugin-retry@8.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15881,"size":4885,"noattachment":false,"key":"/@octokit/plugin-retry/-/@octokit/plugin-retry-8.0.3.tgz"},"type":"module","types":"./dist-types/index.d.ts","engines":{"node":">= 20"},"exports":{".":{"types":"./dist-types/index.d.ts","import":"./dist-bundle/index.js","default":"./dist-bundle/index.js"}},"gitHead":"03f2add1412d547d967c0b0b25ef943ea24cf184","_npmUser":{"name":"octokitbot","email":"security+octokitbot@github.com"},"repository":{"url":"git+https://github.com/octokit/plugin-retry.js.git","type":"git"},"_npmVersion":"11.6.2","description":"Automatic retry plugin for octokit","directories":{},"sideEffects":false,"_nodeVersion":"24.11.0","dependencies":{"bottleneck":"^2.15.3","@octokit/types":"^16.0.0","@octokit/request-error":"^7.0.2"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"glob":"^11.0.0","vitest":"^4.0.0","esbuild":"^0.25.0","prettier":"3.5.3","fetch-mock":"^12.0.0","typescript":"^5.0.0","@types/node":"^22.0.0","@octokit/core":"^7.0.6","@octokit/tsconfig":"^4.0.0","@vitest/coverage-v8":"^4.0.0","semantic-release-plugin-update-version-in-files":"^2.0.0"},"peerDependencies":{"@octokit/core":">=7"},"_npmOperationalInternal":{"tmp":"tmp/plugin-retry_8.0.3_1761872769025_0.08981438949009402","host":"s3://npm-registry-packages-npm-production"},"readme":"# plugin-retry.js\n\n> Retries requests for server 4xx/5xx responses except `400`, `401`, `403`, `404`, `410`, `422`, and `451`.\n\n[![@latest](https://img.shields.io/npm/v/@octokit/plugin-retry.svg)](https://www.npmjs.com/package/@octokit/plugin-retry)\n[![Build Status](https://github.com/octokit/plugin-retry.js/workflows/Test/badge.svg)](https://github.com/octokit/plugin-retry.js/actions?workflow=Test)\n\n## Usage\n\n<table>\n<tbody valign=top align=left>\n<tr><th>\nBrowsers\n</th><td width=100%>\n\nLoad `@octokit/plugin-retry` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [esm.sh](https://esm.sh)\n\n```html\n<script type=\"module\">\n  import { Octokit } from \"https://esm.sh/@octokit/core\";\n  import { retry } from \"https://esm.sh/@octokit/plugin-retry\";\n</script>\n```\n\n</td></tr>\n<tr><th>\nNode\n</th><td>\n\nInstall with `npm install @octokit/core @octokit/plugin-retry`. Optionally replace `@octokit/core` with a core-compatible module\n\n```js\nimport { Octokit } from \"@octokit/core\";\nimport { retry } from \"@octokit/plugin-retry\";\n```\n\n</td></tr>\n</tbody>\n</table>\n\n> [!IMPORTANT]\n> As we use [conditional exports](https://nodejs.org/api/packages.html#conditional-exports), you will need to adapt your `tsconfig.json` by setting `\"moduleResolution\": \"node16\", \"module\": \"node16\"`.\n>\n> See the TypeScript docs on [package.json \"exports\"](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports).<br>\n> See this [helpful guide on transitioning to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) from [@sindresorhus](https://github.com/sindresorhus)\n\n```js\nconst MyOctokit = Octokit.plugin(retry);\nconst octokit = new MyOctokit({ auth: \"secret123\" });\n\n// retries request up to 3 times in case of a 500 response\noctokit.request(\"/\").catch((error) => {\n  if (error.request.request.retryCount) {\n    console.log(\n      `request failed after ${error.request.request.retryCount} retries`,\n    );\n  }\n\n  console.error(error);\n});\n```\n\nTo override the default `doNotRetry` list:\n\n```js\nconst octokit = new MyOctokit({\n  auth: \"secret123\",\n  retry: {\n    doNotRetry: [\n      /* List of HTTP 4xx/5xx status codes */\n    ],\n  },\n});\n```\n\nTo override the number of retries:\n\n```js\nconst octokit = new MyOctokit({\n  auth: \"secret123\",\n  request: { retries: 1 },\n});\n```\n\nYou can manually ask for retries for any request by passing `{ request: { retries: numRetries, retryAfter: delayInSeconds }}`. Note that the `doNotRetry` option from the constructor is ignored in this case, requests will be retried no matter their response code.\n\n```js\noctokit\n  .request(\"/\", { request: { retries: 1, retryAfter: 1 } })\n  .catch((error) => {\n    if (error.request.request.retryCount) {\n      console.log(\n        `request failed after ${error.request.request.retryCount} retries`,\n      );\n    }\n\n    console.error(error);\n  });\n```\n\nPass `{ retry: { enabled: false } }` to disable this plugin.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1761872769232,"_cnpm_publish_time":1761872769232,"dist-tags":{"latest":"8.1.1","release-6.x":"6.1.0"}}