{"id":20661204,"url":"https://github.com/takker99/deno-async-throttle","last_synced_at":"2026-04-21T19:35:38.781Z","repository":{"id":103153487,"uuid":"402995576","full_name":"takker99/deno-async-throttle","owner":"takker99","description":"Throttle implementation for Deno/Web browsers.","archived":false,"fork":false,"pushed_at":"2024-12-24T07:39:43.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-17T12:16:47.336Z","etag":null,"topics":["deno","throttle"],"latest_commit_sha":null,"homepage":"https://jsr.io/@takker/throttle","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/takker99.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}},"created_at":"2021-09-04T07:40:35.000Z","updated_at":"2024-12-24T07:39:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"a7f7d0e2-94fe-4580-9b20-a38d2607fb82","html_url":"https://github.com/takker99/deno-async-throttle","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takker99%2Fdeno-async-throttle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takker99%2Fdeno-async-throttle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takker99%2Fdeno-async-throttle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takker99%2Fdeno-async-throttle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takker99","download_url":"https://codeload.github.com/takker99/deno-async-throttle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242788549,"owners_count":20185289,"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","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":["deno","throttle"],"created_at":"2024-11-16T19:07:51.498Z","updated_at":"2025-12-05T19:02:04.745Z","avatar_url":"https://github.com/takker99.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @takker/throttle\n\n[![JSR](https://jsr.io/badges/@takker/throttle)](https://jsr.io/@takker/throttle)\n[![test](https://github.com/takker99/deno-async-throttle/workflows/ci/badge.svg)](https://github.com/takker99/deno-async-throttle/actions?query=workflow%3Aci)\n\n[Throttle](https://developer.mozilla.org/docs/Glossary/Throttle) implementation\nfor Deno/Web browsers.\n\n## Usage\n\n```ts\nimport { assertEquals, assertRejects } from \"@std/assert\";\nimport { throttle, type ThrottledState } from \"@takker/throttle\";\n\nconst throttledFn = throttle((i: number, state: ThrottledState) =\u003e {\n  if (i === 1 \u0026\u0026 state !== \"discarded\") throw new Error(\"Test error\");\n  return `${i}-${state}`;\n}, { maxQueued: 0 });\n\nassertEquals(await throttledFn(0), \"0-immediate\");\nawait throttledFn.ready;\nawait assertRejects(() =\u003e throttledFn(1), Error, \"Test error\");\nawait throttledFn.ready;\nassertEquals(await throttledFn(2), \"2-immediate\");\nawait throttledFn.ready;\n\nconst promises = Array.from({ length: 4 }).map((_, i) =\u003e throttledFn(i));\nawait throttledFn.ready;\nassertEquals(await promises[0], \"0-immediate\");\nassertEquals(await promises[1], \"1-discarded\");\nassertEquals(await promises[2], \"2-discarded\");\nassertEquals(await promises[3], \"3-delayed\");\nassertEquals(await throttledFn(4), \"4-immediate\");\nawait throttledFn.ready;\nassertEquals(await throttledFn(5), \"5-immediate\");\nawait throttledFn.ready;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakker99%2Fdeno-async-throttle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakker99%2Fdeno-async-throttle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakker99%2Fdeno-async-throttle/lists"}