{"name":"@octokit/plugin-retry","version":"2.1.0","publishConfig":{"access":"public","tag":"latest"},"description":"Automatic retry plugin for octokit","main":"lib/index.js","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","coverage:upload":"nyc report --reporter=text-lcov | coveralls","pretest":"standard","test":"nyc mocha test/"},"repository":{"type":"git","url":"git+https://github.com/octokit/plugin-retry.js.git"},"author":{"name":"Simon Grondin","url":"http://github.com/SGrondin"},"license":"MIT","bugs":{"url":"https://github.com/octokit/plugin-retry.js/issues"},"homepage":"https://github.com/octokit/plugin-retry.js#readme","standard":{"globals":["describe","before","beforeEach","afterEach","after","it","expect"]},"devDependencies":{"@octokit/request":"^2.2.0","@octokit/rest":"^16.3.0","chai":"^4.2.0","coveralls":"^3.0.2","mocha":"^5.2.0","nyc":"^13.1.0","semantic-release":"^15.13.2","standard":"^12.0.1"},"dependencies":{"bottleneck":"^2.15.0"},"gitHead":"a4043a85083d952fd96f4e6979348ebe9f2f2e83","_id":"@octokit/plugin-retry@2.1.0","_npmVersion":"6.5.0","_nodeVersion":"10.15.0","_npmUser":{"name":"octokitbot","email":"octokitbot@martynus.net"},"dist":{"integrity":"sha512-v943O1Z1tu8NvZKDLz/PxbZk4mLMCLVqdCa7t1xVrMIUT6kOjU/IEmMmwVeGFsjG6zZLIDB2fIZVOcPX8FxcFQ==","shasum":"6b8fa2685da680820cae4b2d0e902aff7e37e7e9","tarball":"http://registry-npm.ywwl.com/@octokit/plugin-retry/download/@octokit/plugin-retry-2.1.0.tgz","fileCount":11,"unpackedSize":18663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOk1gCRA9TVsSAnZWagAAPOIQAJQkB09cNkKDUr1jTAVh\noVl0CarHCfxS36aE7gYlD19JCmDMEls6pfIbIErn0XCTrStGeD5VgBzBa5N4\nW8LL5R4AA9zPE3E+brlLoyKsiEMicjc8uVGlcHTJhRO5KPBlgGlCVHexZKyD\nJ7+38iEWwqK4S4OVqjHMiNSQCpyhn3GaQVVN3pbP7WbOjVL3DE4rkw34iaLZ\nldjBn2vAb/wYwUQZXgNRXOWln/F3XPmrASQ6Kc065wTeB9/T1FADq269kGzW\nEc+nvdhDWQT3/pY8EAP8ATkT06at8QeX+Llb+IWQOsdwyz2CRqOY4kYa9J6/\nmJtktiGdzEdJt9yr/jdQucFkxgi4VxNoiD8D6n3o0ZWkeev49+Uszk1gOtAk\nwP8kok86vgrgHqYivFdGUNklMqY3NBh0YT+vneLouLlyYQxat6aog6BiUU+o\nCDMgt+xkQzTFPpUAJA55cEDMEjSCNBxwuMxhFwL25x9FKK+JgRX9l5L+6iKZ\nYB3EX1+hZVu/tCIPe0AdRVWd/21Q19oWn+zzfqBfNikIsMO3hWZH4x3cU+6J\nNp5fcrT03t4XHCpegCOwztyg6+DvslvUEhOWPBCSt07KcCTyDoKI+8Z8jU7b\ncHTIJsxETcVlXrG2o0bE8Bad+gfa2TWKQ+WZNoAnMZqWwZHcAaL6Ls3tA4CI\nhJH8\r\n=6uSO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEcFg7rgBFgzRC8vrtjX76m4pe63z3q1JinVwGsgNfJcAiBn4BwjbkrulBNzxdRWgNrIf3NCB6LX+67JcHHx1QQdHQ=="}],"size":5777,"noattachment":false,"key":"/@octokit/plugin-retry/-/@octokit/plugin-retry-2.1.0.tgz"},"maintainers":[{"name":"bkeepers","email":"brandon@opensoul.org"},{"name":"gr2m","email":"gregor@martynus.net"},{"name":"octokitbot","email":"octokitbot@martynus.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-retry_2.1.0_1547324767812_0.7872215363277411"},"_hasShrinkwrap":false,"readme":"# plugin-retry.js\n\n> Retries requests for server 4xx/5xx responses except `400`, `401`, `403`, `404`, `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":1547324768006,"_cnpm_publish_time":1547324768006,"dist-tags":{"latest":"8.1.1","release-6.x":"6.1.0"}}