{"id":18402082,"url":"https://github.com/khrj/retried","last_synced_at":"2026-05-02T06:35:42.923Z","repository":{"id":57675462,"uuid":"336349314","full_name":"khrj/retried","owner":"khrj","description":"Deno/ES6+/TypeScript rewrite of https://www.npmjs.com/package/retry","archived":false,"fork":false,"pushed_at":"2021-02-05T19:36:14.000Z","size":10,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-19T22:33:40.955Z","etag":null,"topics":["abstract","deno","exponential-backoff","module","port","retry","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khrj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-05T17:59:16.000Z","updated_at":"2021-10-04T14:52:53.000Z","dependencies_parsed_at":"2022-09-15T05:51:41.503Z","dependency_job_id":null,"html_url":"https://github.com/khrj/retried","commit_stats":null,"previous_names":["khushrajrathod/retried"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/khrj/retried","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrj%2Fretried","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrj%2Fretried/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrj%2Fretried/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrj%2Fretried/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khrj","download_url":"https://codeload.github.com/khrj/retried/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrj%2Fretried/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32525894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abstract","deno","exponential-backoff","module","port","retry","typescript"],"created_at":"2024-11-06T02:41:05.478Z","updated_at":"2026-05-02T06:35:42.902Z","avatar_url":"https://github.com/khrj.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Retried\n\nAbstraction for exponential and custom retry strategies for failed operations.\nThis module is a Deno/ES6+/TypeScript rewrite of the popular `retry` nodejs module\n\n## Example\n\nThe example below will retry a potentially failing `fetch` operation\n`10` times using an exponential backoff strategy. With the default settings, this\nmeans the last attempt is made after `17 minutes and 3 seconds` .\n\n```ts\nimport * as retried from 'https://deno.land/x/retried@1.0.1/mod.ts'\n\nfunction faultTolerantFetch(address: string): Promise\u003cResponse\u003e {\n    return new Promise((resolve, reject) =\u003e {\n        const operation = retried.operation({})\n        operation.attempt(async (currentAttempt: number) =\u003e {\n            try {\n                resolve(await fetch(address))\n                operation.succeed()\n            } catch (error) {\n                console.error(`Attempt ${currentAttempt}, Error:`)\n                console.error(error)\n\n                if (await operation.retry(error)) return\n                reject(error)\n            }\n        })\n    })\n}\n\ntry {\n    const response = await faultTolerantFetch('http://example.com')\n    const body = await response.text()\n    console.log(body)\n} catch (e) {\n    console.error(\"Fetch failed: \")\n    console.error(e)\n}\n```\n\nYou can also configure the factors that go into the exponential\nbackoff. See the API documentation below for all available settings.\n\n```ts\nconst operation = retry.operation({\n    retries: 5,\n    factor: 3,\n    minTimeout: 1 * 1000,\n    maxTimeout: 60 * 1000,\n    randomize: true,\n})\n```\n\n## API\n\nSee:\n- https://doc.deno.land/https/deno.land/x/retried@1.0.1/lib/retried.ts and\n- https://doc.deno.land/https/deno.land/x/retried@1.0.1/lib/retryOperation.ts\n\n## License\n\nRetried is licensed under the MIT license.\nCode is adapted from https://github.com/tim-kos/node-retry (also under the MIT license)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhrj%2Fretried","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhrj%2Fretried","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhrj%2Fretried/lists"}