{"id":43767597,"url":"https://github.com/luispabon/superagent-retry-delay","last_synced_at":"2026-02-05T16:06:23.178Z","repository":{"id":46054708,"uuid":"97709175","full_name":"luispabon/superagent-retry-delay","owner":"luispabon","description":"Retry superagent requests for common hangups","archived":false,"fork":false,"pushed_at":"2024-07-22T09:18:45.000Z","size":98,"stargazers_count":4,"open_issues_count":1,"forks_count":17,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-27T01:38:51.107Z","etag":null,"topics":["superagent"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/superagent-retry-delay","language":"JavaScript","has_issues":false,"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/luispabon.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-07-19T11:34:11.000Z","updated_at":"2024-07-22T09:18:03.000Z","dependencies_parsed_at":"2023-02-09T11:16:14.442Z","dependency_job_id":"ef14ae7b-5ee7-49ef-bcb9-cb6027269e8e","html_url":"https://github.com/luispabon/superagent-retry-delay","commit_stats":{"total_commits":108,"total_committers":14,"mean_commits":7.714285714285714,"dds":0.2592592592592593,"last_synced_commit":"5a6a7c15624dd558e77c4207b2435a82f50daf69"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/luispabon/superagent-retry-delay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luispabon%2Fsuperagent-retry-delay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luispabon%2Fsuperagent-retry-delay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luispabon%2Fsuperagent-retry-delay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luispabon%2Fsuperagent-retry-delay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luispabon","download_url":"https://codeload.github.com/luispabon/superagent-retry-delay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luispabon%2Fsuperagent-retry-delay/sbom","scorecard":{"id":603639,"data":{"date":"2025-08-11","repo":{"name":"github.com/luispabon/superagent-retry-delay","commit":"4cf81b235c1798d61f857122dba3c183d06aa9e4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":3,"reason":"Found 4/11 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/luispabon/superagent-retry-delay/publish.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/luispabon/superagent-retry-delay/publish.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yaml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/luispabon/superagent-retry-delay/tests.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yaml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/luispabon/superagent-retry-delay/tests.yaml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/publish.yaml:27","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish.yaml:1","Warn: no topLevel permission defined: .github/workflows/tests.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yaml:12"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T01:05:28.215Z","repository_id":46054708,"created_at":"2025-08-21T01:05:28.215Z","updated_at":"2025-08-21T01:05:28.215Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29125121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T14:05:12.718Z","status":"ssl_error","status_checked_at":"2026-02-05T14:03:53.078Z","response_time":65,"last_error":"SSL_read: 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":["superagent"],"created_at":"2026-02-05T16:06:22.545Z","updated_at":"2026-02-05T16:06:23.171Z","avatar_url":"https://github.com/luispabon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# superagent-retry-delay\n\nExtends the node version of [superagent's](https://github.com/visionmedia/superagent) `Request`, adds a `.retry` method\nto add retrying logic to the request. Calling this will retry the request however many additional times you'd like after\na specified delay in miliseconds.\n\nIt will retry on any error condition, except for the list of response codes optionally supplied.\n\nv2 relies on superagent's internal retry mechanism for retrying, added on superagent 3.5. Use v1 otherwise.\n\nThis library is based on [superagent-retry](https://github.com/segmentio/superagent-retry) and\nextends [superagent](https://github.com/visionmedia/superagent)\n\n## Usage\n\nThe main addition over superagent is the retry function:\n\n```javascript\n/**\n * @param {Number} retries\n * @param {Number[] || Number} delays\n * @param {Number[]} allowedStatuses\n * @param {retryCallback} retryCallback\n * @callback retryCallback\n * @return {retry}\n */\nfunction retry (retries, delays, allowedStatuses, retryCallback) {}\n```\n\n**Function params:**\n\n* `retries`: max number of retries to attempt\n* `delays`: delay between retries, in miliseconds. It can be either:\n    * **a single number:** delay between all retries\n    * **a list of numbers:** delays between the first few retries, in order given. If there are more retries than\n      numbers on this list, any subsequent retries will be delayed by the last number on the list.\n* `allowedStatuses`: list of HTTP statuses that aren't considered a failure by which we need to retry\n* `retryCallback`: this callback takes two arguments, the err, and the `response` object, and must performs an evaluation on it\n  that must return either `true` or `false`. Returning `false` stops any further retries.\n\n### Examples\n```javascript\n// With superagent\nconst superagent = require('superagent');\nrequire('superagent-retry-delay')(superagent);\n\nsuperagent\n  .get('https://segment.io')\n  .retry(2, 5000, [401, 404]) // retry twice before responding, wait 5 seconds between failures, do not retry when response is success, or 401 or 404\n  .end(onresponse);\n\nsuperagent\n  .get('https://segment.io')\n  .retry(3, [1000, 3000, 10000], [401, 404]) // retry three times before responding, first wait 1 second, then 3 seconds, and finally 10 seconds between failures, do not retry when response is success, or 401 or 404\n  .end(onresponse);\n\nsuperagent\n  .get('https://segment.io')\n  .retry(5, [1000, 3000], [401, 404]) // retry five times before responding, first wait 1 second, and then wait 3 seconds between all other failures, do not retry when response is success, or 401 or 404\n  .end(onresponse);\n\nsuperagent\n  .get('https://segment.io')\n  .retry(5, [1000, 3000], [], (err, res) =\u003e {\n    if (res.status === 400 \u0026\u0026 res.text.includes('banana')) {\n      return true\n    }\n    return false;\n  }) // retry five times before responding, first wait 1 second, and then wait 3 seconds between all other failures, retry if code is 400 and body contains banana\n  .end(onresponse);\n\nfunction onresponse (err, res) {\n  console.log(res.status, res.headers);\n  console.log(res.body);\n}\n\n```\n\n```javascript\n// With supertest\nconst superagent = require('superagent');\nrequire('superagent-retry-delay')(superagent);\n\nconst supertest = require('supertest');\n```\n\n## Mocha users\n\nEnsure your mocha timeout for tests (default is 2000ms) is long enough to accommodate for all possible retries,\nincluding the specified delays.\n\n## Retrying Cases\n\nCurrently the retrying logic checks for any error, but it will allow a list of status codes to avoid retrying - this is\nhandy if you're testing say 404's.\n\n## License\n\nSee [MIT License document](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluispabon%2Fsuperagent-retry-delay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluispabon%2Fsuperagent-retry-delay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluispabon%2Fsuperagent-retry-delay/lists"}