{"id":22828696,"url":"https://github.com/busterc/promise-do-until","last_synced_at":"2025-07-23T13:35:21.911Z","repository":{"id":65371312,"uuid":"46890368","full_name":"busterc/promise-do-until","owner":"busterc","description":":loop: Calls a function repeatedly until a condition returns true and then resolves the promise","archived":false,"fork":false,"pushed_at":"2018-08-25T21:46:41.000Z","size":6,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-15T08:55:23.909Z","etag":null,"topics":["es6-promise","flow-control","promise","promise-library","promise-modules","promises"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/busterc.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":"2015-11-25T22:11:37.000Z","updated_at":"2023-09-08T17:04:02.000Z","dependencies_parsed_at":"2023-01-19T22:35:17.162Z","dependency_job_id":null,"html_url":"https://github.com/busterc/promise-do-until","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/busterc/promise-do-until","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fpromise-do-until","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fpromise-do-until/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fpromise-do-until/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fpromise-do-until/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/busterc","download_url":"https://codeload.github.com/busterc/promise-do-until/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fpromise-do-until/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266689315,"owners_count":23969142,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["es6-promise","flow-control","promise","promise-library","promise-modules","promises"],"created_at":"2024-12-12T19:11:38.996Z","updated_at":"2025-07-23T13:35:21.878Z","avatar_url":"https://github.com/busterc.png","language":"JavaScript","readme":"# promise-do-until [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]\n\u003e Calls a function repeatedly until a condition returns true and then resolves the promise\n\n- See Also\n  - [promise-until](https://github.com/busterc/promise-until)\n  - [promise-whilst](https://github.com/sindresorhus/promise-whilst)\n  - [promise-do-whilst](https://github.com/busterc/promise-do-whilst)\n\n## Installation\n\n```sh\n$ npm install --save promise-do-until\n```\n\n## Usage\n\n```js\nimport promiseDoUntil from 'promise-do-until';\n\nlet count = 0;\n\npromiseDoUntil(() =\u003e {\n  count++;\n}, () =\u003e {\n  return count === 5;\n}).then(() =\u003e {\n  console.log(count);\n  // =\u003e 5\n});\n\n// ...\n\nlet max = 0;\n\npromiseDoUntil(() =\u003e {\n  max++;\n}, () =\u003e {\n  return max \u003e -1;\n}).then(() =\u003e {\n  console.log(max);\n  // =\u003e 1\n});\n\n```\n\n## API\n\n### promiseDoUntil(action, condition)\n\nExecutes `action` repeatedly until `condition` returns `true` and then resolves the promise. Rejects if `action` returns a promise that rejects or if an error is thrown anywhere.\n\n#### action\n\nType: `function`\n\nAction to run for each iteration.\n\nYou can return a promise and it will be handled.\n\n#### condition\n\nType: `function`\n\nShould return a boolean of whether to continue.\n\n## License\n\nISC © [Buster Collings]()\n\n\n[npm-image]: https://badge.fury.io/js/promise-do-until.svg\n[npm-url]: https://npmjs.org/package/promise-do-until\n[travis-image]: https://travis-ci.org/busterc/promise-do-until.svg?branch=master\n[travis-url]: https://travis-ci.org/busterc/promise-do-until\n[daviddm-image]: https://david-dm.org/busterc/promise-do-until.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/busterc/promise-do-until\n","funding_links":[],"categories":["Convenience Utilities"],"sub_categories":["Others"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusterc%2Fpromise-do-until","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbusterc%2Fpromise-do-until","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusterc%2Fpromise-do-until/lists"}