{"id":20435944,"url":"https://github.com/d4nyll/resolve-when","last_synced_at":"2026-01-22T13:48:40.175Z","repository":{"id":44119170,"uuid":"148385498","full_name":"d4nyll/resolve-when","owner":"d4nyll","description":"Returns a promise that resolves once condition is met","archived":false,"fork":false,"pushed_at":"2023-01-04T04:30:15.000Z","size":516,"stargazers_count":1,"open_issues_count":19,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T17:06:32.213Z","etag":null,"topics":["javascript","nodejs","promise"],"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/d4nyll.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":"2018-09-11T22:00:08.000Z","updated_at":"2023-03-10T09:27:03.000Z","dependencies_parsed_at":"2023-02-01T20:30:55.162Z","dependency_job_id":null,"html_url":"https://github.com/d4nyll/resolve-when","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/d4nyll/resolve-when","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4nyll%2Fresolve-when","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4nyll%2Fresolve-when/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4nyll%2Fresolve-when/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4nyll%2Fresolve-when/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d4nyll","download_url":"https://codeload.github.com/d4nyll/resolve-when/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4nyll%2Fresolve-when/sbom","scorecard":{"id":315855,"data":{"date":"2025-08-11","repo":{"name":"github.com/d4nyll/resolve-when","commit":"fcc69e75174c1d9966f37f4cc3e9801b7c5b211a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"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":"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":"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":"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":"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 4 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"}},{"name":"Vulnerabilities","score":0,"reason":"25 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T00:10:00.879Z","repository_id":44119170,"created_at":"2025-08-18T00:10:00.879Z","updated_at":"2025-08-18T00:10:00.879Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28664019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"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":["javascript","nodejs","promise"],"created_at":"2024-11-15T08:38:34.180Z","updated_at":"2026-01-22T13:48:40.157Z","avatar_url":"https://github.com/d4nyll.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# resolve-when\n\n[![Build Status](https://travis-ci.org/d4nyll/resolve-when.svg?branch=master)](https://travis-ci.org/d4nyll/resolve-when)\n[![Known Vulnerabilities](https://snyk.io/test/github/d4nyll/resolve-when/badge.svg?targetFile=package.json)](https://snyk.io/test/github/d4nyll/resolve-when?targetFile=package.json)\n[![CodeFactor](https://www.codefactor.io/repository/github/d4nyll/resolve-when/badge)](https://www.codefactor.io/repository/github/d4nyll/resolve-when)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/971a7adcbbd447e98e08b988f6efa6f3)](https://www.codacy.com/app/d4nyll/resolve-when?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=d4nyll/resolve-when\u0026amp;utm_campaign=Badge_Grade)\n[![Maintainability](https://api.codeclimate.com/v1/badges/ab7ed927aff7ca1e71eb/maintainability)](https://codeclimate.com/github/d4nyll/resolve-when/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/ab7ed927aff7ca1e71eb/test_coverage)](https://codeclimate.com/github/d4nyll/resolve-when/test_coverage)\n[![Inline docs](http://inch-ci.org/github/d4nyll/resolve-when.svg?branch=master)](http://inch-ci.org/github/d4nyll/resolve-when)\n[![Greenkeeper badge](https://badges.greenkeeper.io/d4nyll/resolve-when.svg)](https://greenkeeper.io/)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fd4nyll%2Fresolve-when.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fd4nyll%2Fresolve-when?ref=badge_shield)\n\nReturns a promise that resolves once condition is met\n\n## Installation\n\n[![NPM](https://nodei.co/npm/resolve-when.png?compact=true)](https://nodei.co/npm/resolve-when/)\n\n`resolve-when` is published at [npmjs.com](https://www.npmjs.com/), and can be installed using [`npm`](https://docs.npmjs.com/cli/npm) or [`yarn`](https://yarnpkg.com/lang/en/).\n\n```bash\n$ npm install resolve-when  # npm\n$ yarn add resolve-when     # yarn\n```\n\n```js\nimport resolveWhen from 'resolve-when';       // ES6+\nconst resolveWhen = require('resolve-when');  // ES5\n```\n\n## Usage\n\n`resolveWhen` is a function with the following signature:\n\n```\nresolveWhen(condition, options)\n```\n\n* `condition` _Function_ - a function that will be evaluated to determine when `resolveWhen` should resolve. It is not passed any parameters. Defaults to a function that always resolves to `true`\n* `options` _Object_\n  * `max` _Integer_ - Maximum number of times that `condition` should be ran. If `max` is undefined, `0`, a negative number, or `Infinity`, it will iterate forever. Defaults to `undefined`\n  * `interval` _Integer_ - Number of milliseconds to wait before running `condition` again. Defaults to `50`\n\n### Defaults properties\n\n`resolveWhen.defaults` is a read-only property containing the default `options` object used.\n\n### Return Values\n\nIf `condition` returns true, `resolveWhen` will resolve without any value.\n\nIf the maximum number of iterations has been reached and `condition` has not returned `true`, `resolveWhen` will reject with ``Error(`Maximum iterations (${max}) exceeded`)``, where `max` is the same as `options.max`\n\n## Contributing\n\n```bash\n$ git clone git@github.com:d4nyll/resolve-when.git\n$ yarn\n$ yarn run test\n```\n\n### Tests\n\nTests are written in [Mocha](https://mochajs.org/) with the [`assert`](https://nodejs.org/api/assert.html) module. We are also using [`lolex`](https://github.com/sinonjs/lolex) as a fake timer to ensure our unit tests run as quick as possible. \n\n### Code Quality\n\nWe have used [`husky`](https://github.com/typicode/husky) to help you ensure:\n\n* Your code is linted\n* All tests pass\n* Coverage is at 100%\n\nAny PRs which does not pass the linter, tests or coverage tools will be rejected.\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fd4nyll%2Fresolve-when.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fd4nyll%2Fresolve-when?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4nyll%2Fresolve-when","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd4nyll%2Fresolve-when","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4nyll%2Fresolve-when/lists"}