{"id":40510181,"url":"https://github.com/appium/asyncbox","last_synced_at":"2026-01-20T20:02:42.199Z","repository":{"id":24171059,"uuid":"27561476","full_name":"appium/asyncbox","owner":"appium","description":"A collection of ES7 async/await utilities","archived":false,"fork":false,"pushed_at":"2025-12-18T18:14:32.000Z","size":150,"stargazers_count":25,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-21T03:10:37.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appium.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"appium"}},"created_at":"2014-12-04T21:44:03.000Z","updated_at":"2025-12-18T18:14:36.000Z","dependencies_parsed_at":"2024-01-12T00:27:05.471Z","dependency_job_id":"610470ea-34d4-4589-9ab6-52cfeae734ae","html_url":"https://github.com/appium/asyncbox","commit_stats":{"total_commits":83,"total_committers":11,"mean_commits":7.545454545454546,"dds":0.3012048192771084,"last_synced_commit":"d0adc2145673c66c1b64c83739dfcaef4f59d3e1"},"previous_names":["appium/asyncbox"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/appium/asyncbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fasyncbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fasyncbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fasyncbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fasyncbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appium","download_url":"https://codeload.github.com/appium/asyncbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fasyncbox/sbom","scorecard":{"id":523445,"data":{"date":"2025-08-11","repo":{"name":"github.com/jlipps/asyncbox","commit":"ac95eb0d2722e2d6816980209f2586c3a94985ba"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"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":"Code-Review","score":3,"reason":"Found 8/24 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pr-title.yml:1","Warn: no topLevel permission defined: .github/workflows/unit-test.yml: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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-title.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/jlipps/asyncbox/pr-title.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/jlipps/asyncbox/unit-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/jlipps/asyncbox/unit-test.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/unit-test.yml:29","Info:   0 out of   2 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":"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":"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":"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: Apache License 2.0: 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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 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-20T03:40:26.173Z","repository_id":24171059,"created_at":"2025-08-20T03:40:26.173Z","updated_at":"2025-08-20T03:40:26.173Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28612157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2026-01-20T20:01:10.390Z","updated_at":"2026-01-20T20:02:42.184Z","avatar_url":"https://github.com/appium.png","language":"TypeScript","funding_links":["https://opencollective.com/appium"],"categories":[],"sub_categories":[],"readme":"asyncbox\n========\n\nA collection of ES7 async/await utilities. Install via NPM:\n\n```\nnpm install asyncbox\n```\n\nThen, behold!\n\n### Sleep\n\nAn async/await version of setTimeout\n\n```js\nimport { sleep } from 'asyncbox';\n\nasync function myFn () {\n    // do some stuff\n    await sleep(1000); // wait one second\n    // do some other stuff\n};\n```\n\n### Long Sleep\n\nSometimes `Promise.delay` or `setTimeout` are inaccurate for large wait times. To safely wait for these long times (e.g. in the 5+ minute range), you can use `longSleep`:\n\n```js\nimport { longSleep } from 'asyncbox';\n\nasync function myFn () {\n  await longSleep(10 * 60 * 1000); // wait for 10 mins\n  await longSleep(5000, {thresholdMs: 10000}); // wait for 5s. Anything below the thresholdMs will use a single sleep\n  await longSleep(5000, {intervalMs: 500}); // check the clock every 500ms to see if waiting should stop\n}\n```\n\nYou can also pass a `progressCb` option which is a callback function that receives an object with the properties `elapsedMs`, `timeLeft`, and `progress`. This will be called on every wait interval so you can do your wait logging or whatever.\n\n```js\nfunction progressCb({elapsedMs, timeLeft, progress}) {\n  console.log(`We are {progress * 100}% complete waiting`);\n}\nawait longSleep(10 * 60 * 1000, {progressCb});\n```\n\n### Retry\n\nAn async/await way of running a method until it doesn't throw an error\n\n```js\nimport { sleep, retry } from 'asyncbox';\n\nasync function flakeyFunction (val1, val2) {\n    if (val1 \u003c 10) {\n        throw new Error(\"this is a flakey value\");\n    }\n    await sleep(1000);\n    return val1 + val2;\n}\n\nasync function myFn () {\n    let randVals = [Math.random() * 100, Math.random() * 100];\n\n    // run flakeyFunction up to 3 times until it succeeds.\n    // if it doesn't, we'll get the error thrown in this context\n    let randSum = await retry(3, flakeyFunction, ...randVals);\n}\n```\n\nYou can also use `retryInterval` to add a sleep in between retries. This can be\nuseful if you want to throttle how fast we retry:\n\n```js\nawait retryInterval(3, 1500, expensiveFunction, ...args);\n```\n\n### Filter/Map\n\nFilter and map are pretty handy concepts, and now you can write filter and map\nfunctions that execute asynchronously!\n\n```js\nimport { asyncmap, asyncfilter } from 'asyncbox';\n```\n\nThen in your async functions, you can do:\n\n```js\nconst items = [1, 2, 3, 4];\nconst slowSquare = async (n) =\u003e { await sleep(5); return n * 2; };\nlet newItems = await asyncmap(items, async (i) =\u003e { return await slowSquare(i); });\nconsole.log(newItems);  // [1, 4, 9, 16];\n\nconst slowEven = async (n) =\u003e { await sleep(5); return n % 2 === 0; };\nnewItems = await asyncfilter(items, async (i) =\u003e { return await slowEven(i); });\nconsole.log(newItems); // [2, 4];\n```\n\nBy default, `asyncmap` and `asyncfilter` run their operations in parallel; you\ncan pass `false` as a third argument to make sure it happens serially.\n\n### waitForCondition\n\nTakes a condition (a function returning a boolean or boolean promise),\nand waits until the condition is true.\n\nThrows a `/Condition unmet/` error if the condition has not been\nsatisfied within the allocated time, unless an error is provided in\nthe options, as the `error` property, which is either thrown itself, or\nused as the message.\n\nThe condition result is returned if it is not falsy. If the condition\nthrows an error then this exception will be immediately passed through.\n\nThe default options are: `{ waitMs: 5000, intervalMs: 500 }`\n\n```js\n// define your own condition\nfunction condFn () { return Math.random()*1000 \u003e 995; }\n\n// with default params\nawait waitForCondition(condFn);\n\n// with options\nawait waitForCondition(condFn, {\n  waitMs: 300000,\n  intervalMs: 10000\n});\n\n// pass a logger to get extra debug info\nawait waitForCondition(condFn, {\n  waitMs: 300000,\n  intervalMs: 10000\n  logger: myLogger // expects a debug method\n});\n\n// pass an error string to get that message in the resulting exception\ntry {\n  await waitForCondition(condFn, {\n    error: 'Unable to satisfy condition'\n  });\n} catch (err) {\n  // err.message === 'Unable to satisfy condition'\n}\n\n// pass an error instance to be thrown\nconst error = new Error('Unable to satisfy condition');\ntry {\n  await waitForCondition(condFn, {\n    error: error\n  });\n} catch (err) {\n  // err === error\n}\n```\n\n### Run the tests\n\n```\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappium%2Fasyncbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappium%2Fasyncbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappium%2Fasyncbox/lists"}