{"_id":"is-retry-allowed","_rev":"18905","name":"is-retry-allowed","description":"Check whether a request can be retried based on the `error.code`","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T09:59:45.000Z","created":"2016-01-16T08:38:19.114Z","3.0.0":"2021-04-17T07:47:39.599Z","2.2.0":"2020-12-27T18:41:05.877Z","2.1.0":"2020-12-25T12:19:22.677Z","2.0.0":"2020-12-25T03:37:24.294Z","1.2.0":"2019-09-08T08:07:31.992Z","1.1.0":"2016-07-02T22:33:53.617Z","1.0.0":"2016-01-16T08:38:19.114Z"},"users":{"rocket0191":true,"soldair":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-retry-allowed.git"},"versions":{"3.0.0":{"name":"is-retry-allowed","version":"3.0.0","description":"Check whether a request can be retried based on the `error.code`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-retry-allowed.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 && tsd"},"keywords":["retry","retries","allowed","check","http","https","request","fetch"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"6f5ef8c4b28d9d333f9a796d31ec68377a0c826e","bugs":{"url":"https://github.com/sindresorhus/is-retry-allowed/issues"},"homepage":"https://github.com/sindresorhus/is-retry-allowed#readme","_id":"is-retry-allowed@3.0.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"ea79389fd350d156823c491bee9c69f485b1445c","size":2277,"noattachment":false,"key":"/is-retry-allowed/-/is-retry-allowed-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-retry-allowed/download/is-retry-allowed-3.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-retry-allowed_3.0.0_1618645659487_0.986709493832622"},"_hasShrinkwrap":false,"publish_time":1618645659599,"_cnpm_publish_time":1618645659599},"2.2.0":{"name":"is-retry-allowed","version":"2.2.0","description":"Check whether a request can be retried based on the `error.code`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-retry-allowed.git"},"funding":{"url":"https://github.com/sponsors/sindresorhus"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["retry","retries","allowed","check","http","https","request","fetch"],"devDependencies":{"ava":"^3.14.0","tsd":"^0.14.0","xo":"^0.36.1"},"gitHead":"5d4b13f991941dbda9dae0a9b5b4bc2f8c94b6b2","bugs":{"url":"https://github.com/sindresorhus/is-retry-allowed/issues"},"homepage":"https://github.com/sindresorhus/is-retry-allowed#readme","_id":"is-retry-allowed@2.2.0","_nodeVersion":"15.5.0","_npmVersion":"7.3.0","dist":{"shasum":"88f34cbd236e043e71b6932d09b0c65fb7b4d71d","size":2289,"noattachment":false,"key":"/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-retry-allowed/download/is-retry-allowed-2.2.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-retry-allowed_2.2.0_1609094465772_0.6185619465816807"},"_hasShrinkwrap":false,"publish_time":1609094465877,"_cnpm_publish_time":1609094465877},"2.1.0":{"name":"is-retry-allowed","version":"2.1.0","description":"Check whether a request can be retried based on the `error.code`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-retry-allowed.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["retry","retries","allowed","check","http","https","request","fetch"],"devDependencies":{"ava":"^3.14.0","tsd":"^0.14.0","xo":"^0.36.1"},"gitHead":"af8baf12c038ed61ba86dce45e5ac518301d8ea4","bugs":{"url":"https://github.com/sindresorhus/is-retry-allowed/issues"},"homepage":"https://github.com/sindresorhus/is-retry-allowed#readme","_id":"is-retry-allowed@2.1.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.9","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"328843ce5725d7e27b21c3fb2570b7e007eadf96","size":2261,"noattachment":false,"key":"/is-retry-allowed/-/is-retry-allowed-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-retry-allowed/download/is-retry-allowed-2.1.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-retry-allowed_2.1.0_1608898762522_0.9631240861254178"},"_hasShrinkwrap":false,"publish_time":1608898762677,"_cnpm_publish_time":1608898762677},"2.0.0":{"name":"is-retry-allowed","version":"2.0.0","description":"Check whether a request can be retried based on the `error.code`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-retry-allowed.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava"},"keywords":["retry","retries","allowed","check","http","https","request","fetch"],"devDependencies":{"ava":"^2.3.0","xo":"^0.36.1"},"gitHead":"3aac9f3c40db932200c72cf82a9ceb703c03c472","bugs":{"url":"https://github.com/sindresorhus/is-retry-allowed/issues"},"homepage":"https://github.com/sindresorhus/is-retry-allowed#readme","_id":"is-retry-allowed@2.0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.9","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"86c81a5cc7438da7de82c7bf00e711079646a98b","size":2127,"noattachment":false,"key":"/is-retry-allowed/-/is-retry-allowed-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-retry-allowed/download/is-retry-allowed-2.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-retry-allowed_2.0.0_1608867444151_0.4289122639024445"},"_hasShrinkwrap":false,"publish_time":1608867444294,"_cnpm_publish_time":1608867444294},"1.2.0":{"name":"is-retry-allowed","version":"1.2.0","description":"Is retry allowed for Error?","license":"MIT","repository":{"type":"git","url":"git+https://github.com/floatdrop/is-retry-allowed.git"},"author":{"name":"Vsevolod Strukchinsky","email":"floatdrop@gmail.com","url":"github.com/floatdrop"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"keywords":[],"dependencies":{},"devDependencies":{"ava":"^0.8.0","xo":"^0.12.1"},"gitHead":"b2490025b619141fbdf4914867073cda98185e88","bugs":{"url":"https://github.com/floatdrop/is-retry-allowed/issues"},"homepage":"https://github.com/floatdrop/is-retry-allowed#readme","_id":"is-retry-allowed@1.2.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d778488bd0a4666a3be8a1482b9f2baafedea8b4","size":1938,"noattachment":false,"key":"/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-retry-allowed/download/is-retry-allowed-1.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-retry-allowed_1.2.0_1567930051799_0.6496887617592804"},"_hasShrinkwrap":false,"publish_time":1567930051992,"_cnpm_publish_time":1567930051992},"1.1.0":{"name":"is-retry-allowed","version":"1.1.0","description":"My prime module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/floatdrop/is-retry-allowed.git"},"author":{"name":"Vsevolod Strukchinsky","email":"floatdrop@gmail.com","url":"github.com/floatdrop"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":[],"dependencies":{},"devDependencies":{"ava":"^0.8.0","xo":"^0.12.1"},"gitHead":"8ca0d01b23b0a92bcf232d97801c3f08c41231a3","bugs":{"url":"https://github.com/floatdrop/is-retry-allowed/issues"},"homepage":"https://github.com/floatdrop/is-retry-allowed#readme","_id":"is-retry-allowed@1.1.0","_shasum":"11a060568b67339444033d0125a61a20d564fb34","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"floatdrop","email":"floatdrop@gmail.com"},"dist":{"shasum":"11a060568b67339444033d0125a61a20d564fb34","size":1959,"noattachment":false,"key":"/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-retry-allowed/download/is-retry-allowed-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/is-retry-allowed-1.1.0.tgz_1467498831328_0.0396464669611305"},"directories":{},"publish_time":1467498833617,"_hasShrinkwrap":false,"_cnpm_publish_time":1467498833617},"1.0.0":{"name":"is-retry-allowed","version":"1.0.0","description":"My prime module","license":"MIT","repository":{"type":"git","url":"https://github.com/floatdrop/is-retry-allowed"},"author":{"name":"Vsevolod Strukchinsky","email":"floatdrop@gmail.com","url":"github.com/floatdrop"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":[],"dependencies":{},"devDependencies":{"ava":"^0.8.0","xo":"^0.12.1"},"gitHead":"df50b6de4b86ff0931444c6e59455fb2c1867052","bugs":{"url":"https://github.com/floatdrop/is-retry-allowed/issues"},"homepage":"https://github.com/floatdrop/is-retry-allowed","_id":"is-retry-allowed@1.0.0","_shasum":"2b2070b151823d4044a8bbbf6285b0c42b8703de","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.4","_npmUser":{"name":"floatdrop","email":"floatdrop@gmail.com"},"dist":{"shasum":"2b2070b151823d4044a8bbbf6285b0c42b8703de","size":1591,"noattachment":false,"key":"/is-retry-allowed/-/is-retry-allowed-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-retry-allowed/download/is-retry-allowed-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1452933499114,"_hasShrinkwrap":false,"_cnpm_publish_time":1452933499114}},"readme":"# is-retry-allowed\n\n> Check whether a request can be retried based on the `error.code`\n\n## Install\n\n```\n$ npm install is-retry-allowed\n```\n\n## Usage\n\n```js\nimport isRetryAllowed from 'is-retry-allowed';\n\nisRetryAllowed({code: 'ETIMEDOUT'});\n//=> true\n\nisRetryAllowed({code: 'ENOTFOUND'});\n//=> false\n\nisRetryAllowed({});\n//=> true\n```\n\n## API\n\n### isRetryAllowed(error)\n\n#### error\n\nType: `Error | object`\n\nThe `.code` property, if it exists, will be used to determine whether retry is allowed.\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-is-retry-allowed?utm_source=npm-is-retry-allowed&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/is-retry-allowed#readme","bugs":{"url":"https://github.com/sindresorhus/is-retry-allowed/issues"},"license":"MIT"}