{"id":47793488,"url":"https://github.com/adametherzlab/retry-ts","last_synced_at":"2026-04-03T16:00:01.295Z","repository":{"id":343166979,"uuid":"1173478829","full_name":"AdametherzLab/retry-ts","owner":"AdametherzLab","description":"Typed retry with exponential backoff, jitter, and AbortController support","archived":false,"fork":false,"pushed_at":"2026-03-09T06:38:16.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-09T11:40:30.958Z","etag":null,"topics":["async","backoff","bun","resilience","retry","typescript"],"latest_commit_sha":null,"homepage":null,"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/AdametherzLab.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-05T12:11:49.000Z","updated_at":"2026-03-09T06:38:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AdametherzLab/retry-ts","commit_stats":null,"previous_names":["adametherzlab/retry-ts"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/AdametherzLab/retry-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdametherzLab%2Fretry-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdametherzLab%2Fretry-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdametherzLab%2Fretry-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdametherzLab%2Fretry-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdametherzLab","download_url":"https://codeload.github.com/AdametherzLab/retry-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdametherzLab%2Fretry-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31362630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T15:19:21.178Z","status":"ssl_error","status_checked_at":"2026-04-03T15:19:20.670Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["async","backoff","bun","resilience","retry","typescript"],"created_at":"2026-04-03T16:00:00.673Z","updated_at":"2026-04-03T16:00:01.287Z","avatar_url":"https://github.com/AdametherzLab.png","language":"TypeScript","readme":"# retry-ts 🔄\n\n[![CI](https://github.com/AdametherzLab/retry-ts/actions/workflows/ci.yml/badge.svg)](https://github.com/AdametherzLab/retry-ts/actions) [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)](https://www.typescriptlang.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n**Type-Safe Retries with Custom Backoff Strategies, Jitter, and Abort Support**\n\n## Features\n\n- **Custom backoff strategies**: exponential, linear, fixed, or bring your own\n- Configurable jitter strategies (none, full, equal, decorrelated)\n- Timeout and AbortController support\n- Custom retry conditions via `shouldRetry`\n- Error filtering with `retryOn` and `abortOn` for granular control\n- Zero dependencies — pure TypeScript/ESM\n\n## Installation\n\nbash\nbun add @adametherzlab/retry-ts\n\n\n## Quick Start\n\n\nimport { retry } from '@adametherzlab/retry-ts';\n\nconst fetchData = async (signal: AbortSignal) =\u003e {\n  const response = await fetch('https://api.example.com/data', { signal });\n  if (!response.ok) {\n    throw new Error(`HTTP error! status: ${response.status}`);\n  }\n  return response.json();\n};\n\n// Basic retry with exponential backoff and no jitter\ntry(fetchData, {\n  maxAttempts: 3,\n  baseDelayMs: 200,\n});\n\n// Use linear backoff with decorrelated jitter\nconst data = await retry(fetchData, {\n  maxAttempts: 5,\n  baseDelayMs: 100,\n  maxDelayMs: 5000,\n  backoffStrategy: 'linear',\n  jitterStrategy: 'decorrelated'\n});\n\nconsole.log('Data fetched:', data);\n\n// Retry only on specific errors\nclass NetworkError extends Error {}\n\nconst flakyOperation = async () =\u003e {\n  if (Math.random() \u003c 0.7) {\n    throw new NetworkError('Connection lost');\n  }\n  return 'Success!';\n};\n\ntry(flakyOperation, {\n  maxAttempts: 5,\n  retryOn: NetworkError, // Only retry if NetworkError is thrown\n  baseDelayMs: 50,\n  jitterStrategy: 'full'\n});\n\n// Abort retries if a specific error occurs\nclass AuthError extends Error {}\n\nconst authProtectedOperation = async () =\u003e {\n  if (Math.random() \u003c 0.5) {\n    throw new NetworkError('Connection lost');\n  } else if (Math.random() \u003c 0.2) {\n    throw new AuthError('Unauthorized');\n  }\n  return 'Authorized data!';\n};\n\ntry(authProtectedOperation, {\n  maxAttempts: 5,\n  retryOn: NetworkError,\n  abortOn: AuthError, // Stop immediately if AuthError is thrown\n  baseDelayMs: 50,\n  jitterStrategy: 'equal'\n});\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadametherzlab%2Fretry-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadametherzlab%2Fretry-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadametherzlab%2Fretry-ts/lists"}