{"id":18539045,"url":"https://github.com/simov/async-harmony","last_synced_at":"2025-08-30T02:09:05.635Z","repository":{"id":17155739,"uuid":"19922612","full_name":"simov/async-harmony","owner":"simov","description":"Asynchronous Harmonies","archived":false,"fork":false,"pushed_at":"2014-09-17T06:45:12.000Z","size":276,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-03T07:51:39.708Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/simov.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":"2014-05-18T22:27:38.000Z","updated_at":"2024-09-09T20:31:23.000Z","dependencies_parsed_at":"2022-09-26T21:21:42.879Z","dependency_job_id":null,"html_url":"https://github.com/simov/async-harmony","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/simov/async-harmony","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fasync-harmony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fasync-harmony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fasync-harmony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fasync-harmony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simov","download_url":"https://codeload.github.com/simov/async-harmony/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fasync-harmony/sbom","scorecard":{"id":825319,"data":{"date":"2025-08-11","repo":{"name":"github.com/simov/async-harmony","commit":"0fe9e5a3cb8b503b2462fb8c9ed2267f33aef918"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/21 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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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-23T16:30:39.762Z","repository_id":17155739,"created_at":"2025-08-23T16:30:39.762Z","updated_at":"2025-08-23T16:30:39.762Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272793018,"owners_count":24993830,"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-30T02:00:09.474Z","response_time":77,"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":"2024-11-06T19:45:59.124Z","updated_at":"2025-08-30T02:09:05.611Z","avatar_url":"https://github.com/simov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Async Harmony\n**async-harmony** is a module for managing asynchronous control flow using Generators\n\n\n## Status\n\u003e As of _15 May 2014_ this module is tested only in _Firefox 29_ running on _Ubuntu_\n\n\n## Harmony Syntax Features Used\n\u003e `Generators (yield)`, `arrow functions`, `let`, `default function params`, `For..of loops`\n\nTake a look at the [ECMAScript 6 compatibility table][0]\n\n\n## Install\n```bash\n$ npm install async-harmony\n```\nYou can also use this module as an _amd_ module or a global object in the browser\n\n\n## Tests\n[Tests][5]\n\n\n## Examples\n[Examples][6]\n\n\n## Methods\n## series(jobs, done, kill=true)\n\u003e _Process a list of tasks sequentially_\n\n- _**jobs**_ - `[]` or `{}` of jobs to execute\n  - each job is `function(args, done)` where\n  - `args` - contains the results from all previous jobs, and intermediate results passed between the jobs\n  - `done(err, result)` - return error and result\n- _**done(err, result)**_ - callback to execute once all jobs are done\n- _**kill**_ - `true` or `false` - determines whether to stop the job queue on first error received or not\n\n```js\nasync.series({\n  job1: (args, done) =\u003e {\n    done(null, 'result1');\n  },\n  job2: (args, done) =\u003e {\n    done(null, 'result2');\n  }\n}, (err, result) =\u003e {\n  result == {job1:'result1', job2:'result2'}\n});\n```\n[examples][1]\n\n\n## eachSeries (items, job, done, kill=true)\n\u003e _Process a list of items sequentially_\n\n- _**items**_ - `[]` of items to process\n- _**job**_ - `function(err, done)` to execute for each item\n  - `done(err, result)` - return error and result\n- _**done(err, result)**_ - callback to execute once all items are processed\n- _**kill**_ - `true` or `false` - determines whether to stop the job queue on first error received or not\n\n```js\nasync.eachSeries([0,1], (item, done) =\u003e {\n  done(null, 'result'+item);\n}, (err, result) =\u003e {\n  result == ['result0', 'result1']\n});\n```\n[examples][2]\n\n\n## each (items, job, done, kill=false)\n\u003e _Process a list of items in parallel_\n\n- _**items**_ - `[]` of items to process\n- _**job**_ - `function(err, done)` to execute for each item\n  - `done(err, result)` - return error and result\n- _**done(err, result)**_ - callback to execute once all items are processed\n- _**kill**_ - `true` or `false` - determines whether to stop the job queue on first error received or not\n\n```js\nasync.each([0,1], (item, done) =\u003e {\n  done(null, 'result'+item);\n}, (err, result) =\u003e {\n  result == ['result0', 'result1']\n});\n```\n[examples][2]\n\n\n## eachLimit (limit, items, job, done, kill=false)\n\u003e _Process a list of items in parallel, limiting the number of items to process simultaneously_\n\n- _**limit**_ - number of items to process simultaneously\n- _**items**_ - `[]` of items to process\n- _**job**_ - `function(err, done)` to execute for each item\n  - `done(err, result)` - return error and result\n- _**done(err, result)**_ - callback to execute once all items are processed\n- _**kill**_ - `true` or `false` - determines whether to stop the job queue on first error received or not\n\n```js\nasync.eachLimit(2, [0,1,2], (item, done) =\u003e {\n  done(null, 'result'+item);\n}, (err, result) =\u003e {\n  result == ['result0', 'result1', 'result2']\n});\n```\n[examples][2]\n\n\n## parallel (jobs, done, kill=false)\n\u003e _Process a list of tasks in parallel_\n\n- _**jobs**_ - `[]` or `{}` of jobs to execute\n  - each job is `function(done)` where\n  - `done(err, result)` - return error and result\n- _**done(err, result)**_ - callback to execute once all jobs are done\n- _**kill**_ - `true` or `false` - determines whether to stop the job queue on first error received or not\n\n```js\nasync.parallel({\n  job1: (done) =\u003e {\n    done(null, 'result1');\n  },\n  job2: (done) =\u003e {\n    done(null, 'result2');\n  }\n}, (err, result) =\u003e {\n  result == {job1:'result1', job2:'result2'}\n});\n```\n[examples][3]\n\n\n## parallelLimit (limit, jobs, done, kill=false)\n\u003e _Process a list of tasks in parallel, limiting the number of tasks to process simultaneously_\n\n- _**limit**_ - number of jobs to process simultaneously\n- _**jobs**_ - `[]` or `{}` of jobs to execute\n  - each job is `function(done)` where\n  - `done(err, result)` - return error and result\n- _**done(err, result)**_ - callback to execute once all jobs are done\n- _**kill**_ - `true` or `false` - determines whether to stop the job queue on first error received or not\n\n```js\nasync.parallelLimit(2, {\n  job1: (done) =\u003e {\n    done(null, 'result1');\n  },\n  job2: (done) =\u003e {\n    done(null, 'result2');\n  },\n  job3: (done) =\u003e {\n    done(null, 'result3');\n  }\n}, (err, result) =\u003e {\n  result == {job1:'result1', job2:'result2', job2:'result3'}\n});\n```\n[examples][3]\n\n\n## forever (job, done)\n\u003e _Execute a task indefinitely (or until an error occur)_\n\n- _**job**_ - task to execute\n  - job is `function(done)` where\n  - `done(err)` - return error\n- _**done(err)**_ - callback to execute if an error occur\n\n```js\nvar b = false;\nasync.forever((done) =\u003e {\n  setTimeout(() =\u003e {\n    b = !b;\n    console.log(b ? 'tik' : 'tak');\n    done();\n  }, 1000);\n}, (err) =\u003e {\n  if (err) console.log('Clock stopped!');\n});\n```\n[examples][4]\n\n\n## until (test, job, done)\n\u003e _Execute a task until test condition becomes true_\n\n- _**test**_ - test to execute for each iteration\n- _**job**_ - task to execute\n  - job is `function(done)` where\n  - `done(err)` - return error\n- _**done(err)**_ - callback to execute when the test condition is met or if an error occur\n\n```js\nvar count = 0;\nasync.until(\n  () =\u003e (count == 5),\n  (done) =\u003e {\n    setTimeout(() =\u003e {\n      console.log(++count, 'seconds passed!');\n      done();\n    }, 1000);\n  },\n  (err) =\u003e {\n    if (err) console.log('Counter broke!');\n    else console.log('Done: 5 seconds passed!');\n  }\n);\n```\n[examples][4]\n\n\n## whilst (test, job, done)\n\u003e _Execute a task while test condition is true_\n\n- _**test**_ - test to execute for each iteration\n- _**job**_ - task to execute\n  - job is `function(done)` where\n  - `done(err)` - return error\n- _**done(err)**_ - callback to execute when the test condition becomes false or if an error occur\n\n```js\nvar count = 0;\nasync.whilst(\n  () =\u003e (count \u003c 5),\n  (done) =\u003e {\n    setTimeout(() =\u003e {\n      console.log(++count, 'seconds passed!');\n      done();\n    }, 1000);\n  },\n  (err) =\u003e {\n    if (err) console.log('Counter broke!');\n    else console.log('Done: 5 seconds passed!');\n  }\n);\n```\n[examples][4]\n\n\n## License\n(The MIT License)\n\nCopyright (c) 2014 simov \u0026lt;simeonvelichkov@gmail.com\u0026gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n  [0]: http://kangax.github.io/compat-table/es6/\n  [1]: https://github.com/simov/async-harmony/blob/master/test/series.js\n  [2]: https://github.com/simov/async-harmony/blob/master/test/each.js\n  [3]: https://github.com/simov/async-harmony/blob/master/test/parallel.js\n  [4]: https://github.com/simov/async-harmony/blob/master/test/while.js\n  [5]: http://simov.github.io/async-harmony/test/\n  [6]: http://simov.github.io/async-harmony/test/examples.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimov%2Fasync-harmony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimov%2Fasync-harmony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimov%2Fasync-harmony/lists"}