{"id":16473132,"url":"https://github.com/binki/binki-userscript-delay-async","last_synced_at":"2026-06-09T06:31:24.817Z","repository":{"id":143134182,"uuid":"469267964","full_name":"binki/binki-userscript-delay-async","owner":"binki","description":"A simple `delayAsync()` function for use in userscripts (GreaseMonkey scripts).","archived":false,"fork":false,"pushed_at":"2022-03-13T04:33:27.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-23T06:02:53.866Z","etag":null,"topics":[],"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/binki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2022-03-13T04:20:12.000Z","updated_at":"2022-03-13T04:20:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f66b2ae-848a-4394-a166-f877bb09d07b","html_url":"https://github.com/binki/binki-userscript-delay-async","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/binki/binki-userscript-delay-async","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbinki-userscript-delay-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbinki-userscript-delay-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbinki-userscript-delay-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbinki-userscript-delay-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binki","download_url":"https://codeload.github.com/binki/binki-userscript-delay-async/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbinki-userscript-delay-async/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34095242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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-10-11T12:25:27.150Z","updated_at":"2026-06-09T06:31:24.800Z","avatar_url":"https://github.com/binki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Usage\n\nInclude this in your userscript using [`@require`](https://wiki.greasespot.net/Metadata_Block#.40require). It is recommended to [use a permalink](https://docs.github.com/en/repositories/working-with-files/using-files/getting-permanent-links-to-files) instead of referring to `master`.\n\n```js\n// ==UserScript==\n// @name example\n// @version 1.0\n// @require https://github.com/binki/binki-userscript-delay-async/raw/master/binki-userscript-delay-async.js\n// ==UserScript==\n\n(async () =\u003e {\n  // Log the current time every second (note that setInterval() would be more suited to this use case).\n  while (true) {\n    console.log(`It is now ${new Date()}`);\n    await delayAsync(1000);\n  }\n})();\n```\n\n## API\n\n```js\ndelayAsync(timeout, ct);\n```\n\nParameters:\n\n* `timeout` is a `Number` passed directly to [`setTimeout()`](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout) as its `timeout` (second) argument.\n* `ct` is an [`AbortSignal`](https://dom.spec.whatwg.org/#abortsignal) which can be used to reject the returned `Promise` early with a `new `[`DOMException`](https://webidl.spec.whatwg.org/#idl-DOMException)`(…, `[`'AbortError'`](https://webidl.spec.whatwg.org/#aborterror)`)`.\n\nReturns:\n\nA `Promise` which will resolve to undefined after the delay (negative or omitted delay is treated as `0`) or is rejected with `new `[`DOMException`](https://webidl.spec.whatwg.org/#idl-DOMException)`(…, `[`'AbortError'`](https://webidl.spec.whatwg.org/#aborterror)`)` if a passed in `ct` was aborted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinki%2Fbinki-userscript-delay-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinki%2Fbinki-userscript-delay-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinki%2Fbinki-userscript-delay-async/lists"}