{"id":25620777,"url":"https://github.com/codewell/retry-js","last_synced_at":"2025-10-06T07:39:22.857Z","repository":{"id":42876571,"uuid":"256469276","full_name":"codewell/retry-js","owner":"codewell","description":"Recursively retries a function if it fails","archived":false,"fork":false,"pushed_at":"2023-01-06T03:47:05.000Z","size":1021,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T07:31:49.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/codewell.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":"2020-04-17T10:12:06.000Z","updated_at":"2020-08-20T09:01:10.000Z","dependencies_parsed_at":"2023-02-05T06:16:01.118Z","dependency_job_id":null,"html_url":"https://github.com/codewell/retry-js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/codewell/retry-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewell%2Fretry-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewell%2Fretry-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewell%2Fretry-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewell%2Fretry-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewell","download_url":"https://codeload.github.com/codewell/retry-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewell%2Fretry-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278577889,"owners_count":26009701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"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":[],"created_at":"2025-02-22T07:28:01.482Z","updated_at":"2025-10-06T07:39:22.820Z","avatar_url":"https://github.com/codewell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @codewell/retry\n\nRecursively retries to call a function if the execution fails.\n\n## Installation\n\n```\nnpm install @codewell/retry\n```\n\n## Basic Usage\n\n```JavaScript\nimport retry from '@codewell/retry';\n\nretry(fetch)(\"http://example.com\")\n  .then(data =\u003e {\n    // Do something with the returned data,\n    // in this case an http response,\n    // from fetch(\"http://example.com\")\n  })\n  .catch(error =\u003e {\n    // This is where we end up if all retries\n    // failed to execute\n  });\n```\n\n`retry` will make the function call `fetch(\"http://example.com\")`. If it fails, `retry` will try to call `fetch(\"http://example.com\")` for 3 times (default) before it gives up.\n\n### Configuration\n\n`retry` is also configurable with options:\n\n```JavaScript\nimport retry from '@codewell/retry';\n\nconst options = {\n  // Number of tries before we stop\n  // Default value: 3\n  maxTries: 3,\n\n  // A function that returns number\n  // of milliseconds to wait before\n  // next execution\n  // Default function: (retryCount) =\u003e 1000\n  backoffStrategy: (retryCount) =\u003e 1000,\n\n  // Parameter from 0-2 that sets\n  // how much logging retry should do.\n  // Default value: 1\n  logLevel: 1,\n};\n\nretry(fetch, options)(\"http://example.com\");\n```\n\nThe `options` object is optional to pass. All options are optional to configure.\n\n## Contribution\n\nPlease help by submitting issues and pull requests here on github\nRead more on [codewell's webpage](https://codewell.github.io/contribution)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewell%2Fretry-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewell%2Fretry-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewell%2Fretry-js/lists"}