{"id":22214208,"url":"https://github.com/lordazzi/ecma-async-loop","last_synced_at":"2026-05-05T08:33:28.077Z","repository":{"id":57151190,"uuid":"228634945","full_name":"lordazzi/ecma-async-loop","owner":"lordazzi","description":"JavaScript / TypeScript library to help to perform asynchronous loop","archived":false,"fork":false,"pushed_at":"2021-07-20T20:02:23.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T05:22:30.358Z","etag":null,"topics":["angular","async","async-await","async-foreach","asynchronous","for","foreach","javascript","loop","reactive","reactive-programming","rxjs","typescript","while"],"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/lordazzi.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":"2019-12-17T14:31:41.000Z","updated_at":"2021-07-20T20:02:27.000Z","dependencies_parsed_at":"2022-08-31T20:02:11.275Z","dependency_job_id":null,"html_url":"https://github.com/lordazzi/ecma-async-loop","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lordazzi/ecma-async-loop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordazzi%2Fecma-async-loop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordazzi%2Fecma-async-loop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordazzi%2Fecma-async-loop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordazzi%2Fecma-async-loop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lordazzi","download_url":"https://codeload.github.com/lordazzi/ecma-async-loop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordazzi%2Fecma-async-loop/sbom","scorecard":{"id":599012,"data":{"date":"2025-08-11","repo":{"name":"github.com/lordazzi/ecma-async-loop","commit":"c1d60faf0cef9e639cff0ccfa636259e911ec5cb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"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":"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/8 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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"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":"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":"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"}}]},"last_synced_at":"2025-08-20T23:53:38.714Z","repository_id":57151190,"created_at":"2025-08-20T23:53:38.714Z","updated_at":"2025-08-20T23:53:38.714Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271998609,"owners_count":24856072,"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-08-25T02:00:12.092Z","response_time":1107,"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":["angular","async","async-await","async-foreach","asynchronous","for","foreach","javascript","loop","reactive","reactive-programming","rxjs","typescript","while"],"created_at":"2024-12-02T21:14:25.523Z","updated_at":"2026-05-05T08:33:23.055Z","avatar_url":"https://github.com/lordazzi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ecma-async-loop\nJavaScript / TypeScript library to help to perform asynchronous loop\n\u003e javescripeto de assinchrono\n\n[![npm version](https://badge.fury.io/js/ecma-async-loop.svg)](https://badge.fury.io/js/ecma-async-loop)\n[![Npm Total Downloads](https://img.shields.io/npm/dt/ecma-async-loop.svg)](https://github.com/lordazzi/ecma-async-loop)\n[![Npm Monthly Downloads](https://img.shields.io/npm/dm/ecma-async-loop.svg)](https://github.com/lordazzi/ecma-async-loop)\n[![Build Status](https://travis-ci.org/lordazzi/ecma-async-loop.svg?branch=master)](https://travis-ci.org/lordazzi/ecma-async-loop)\n[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/lordazzi/ecma-async-loop/blob/documentation/LICENSE)\n\n## The problem and the solution\n\nYou have a async function and need to loop it, but the loop structure in ecmascript do not\nallow you to use \"await\" keywork inside a loop (you are allowed, but it does not work) \n```typescript\nasync function yourCustomAsyncFunction(): Promise\u003cvoid\u003e {\n  return new Promise((resolve, reject) =\u003e {\n    setTimeout(() =\u003e {\n      resolve();\n    }, 100);\n  });\n}\n```\n\nit does not work:\n```typescript\nlet index = 0;\nwhile (index \u003c 10) {\n  await yourCustomAsyncFunction();\n}\n```\n\nBut you can do that:\n```typescript\nasyncDoWhile({\n  while: () =\u003e index \u003c 10,\n  execute: () =\u003e yourCustomAsyncFunction()\n}).then(() =\u003e {\n  //  loop complete\n}).catch(e =\u003e {\n  //  some of the functions has broken\n});\n\n//  you can create an execution queue to use in the for each method:\ndeclare someHttpApi(importantData: number): Promise\u003cvoid\u003e;\nconst dataToSendToSomeApi = [ 2, 4, 2, 2, 6 ];\n\n//  here you create an array of async functions (or functions that returns promises)\nconst executionQueue = dataToSendToSomeApi.map(no =\u003e {\n  return () =\u003e someHttpApi(importantData);\n});\n\nasyncForEach(executionQueue).then(() =\u003e {\n  //  loop complete\n}).catch(e =\u003e {\n  //  some of the functions has broken\n});\n```\n\n\n## Instalation\n```sh\nnpm install ecma-async-loop --save\n```\n\n## Contributing\n\n### 1. Create an issue\nNo one feature will be implemented without it having an open issue and without which the proposed has been accepted by the team responsible for the project. After the issue is approved, the applicant, a team member or anyone else can open a pull request associated with that issue (just paste the issue link in the pull request).\n\n### 2. Did you find a bug?\nWhen logging a bug, please be sure to include the following:\n * The library version;\n * If at all possible, an *isolated* way to reproduce the behavior;\n * The behavior you expect to see, and the actual behavior.\n\nYou can try to update the library to the last version to see if the bug has already been fixed.\n\n### 3. Do not create a duplicate issue\n[Search the existing issues](https://github.com/lordazzi/ecma-async-loop/search?type=Issues) before logging a new one.\n\nSome search tips:\n * *Don't* restrict your search to only open issues. An issue with a title similar to yours may have been closed as a duplicate of one with a less-findable title.\n * Check for synonyms. For example, if your bug involves an interface, it likely also occurs with type aliases or classes.\n\n### 4. Create a Pull Request\nFollow the steps:\n\n * Create a [fork](https://guides.github.com/activities/forking/) from our repository by [clicking here](https://github.com/lordazzi/ecma-async-loop/fork), install [node](https://nodejs.org/), do a `git clone` of your forked repository and run `npm install` in the application folder;\n * Create a branch in your forked repository, then code the feature or fix the bug;\n * Run `npm run lint`, `npm run test` and `npm run build` in the repository;\n * Create a Pull Request from your repository to this one, with the issue in the body and some information you think could be usefull to the reviewer (print or a [gif of it working](https://www.screentogif.com/) will be appreciated);\n * The reviewer can ask some changes, don't be mad, this is the GIT Flow process;\n * You get approved and your branch with the feature / fix ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordazzi%2Fecma-async-loop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flordazzi%2Fecma-async-loop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordazzi%2Fecma-async-loop/lists"}