{"id":24033755,"url":"https://github.com/daanv2/queue-processor","last_synced_at":"2026-03-01T10:33:05.788Z","repository":{"id":40573856,"uuid":"417515984","full_name":"DaanV2/queue-processor","owner":"DaanV2","description":"A promise like processor that tries to keep the event-loop as clean as possible","archived":false,"fork":false,"pushed_at":"2025-02-18T15:41:55.000Z","size":191,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-31T19:40:56.625Z","etag":null,"topics":["event","eventloop","js","npm","processor","queue","ts"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@daanv2/queue-processor","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/DaanV2.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-10-15T13:49:06.000Z","updated_at":"2025-02-18T15:41:51.000Z","dependencies_parsed_at":"2025-04-19T14:47:28.335Z","dependency_job_id":"5b32fbe3-58f2-4e1d-a779-58b1ae2a21e4","html_url":"https://github.com/DaanV2/queue-processor","commit_stats":{"total_commits":108,"total_committers":2,"mean_commits":54.0,"dds":"0.37962962962962965","last_synced_commit":"68bd1e2b78d877439359a8a8e2e66959896f2ece"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/DaanV2/queue-processor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaanV2%2Fqueue-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaanV2%2Fqueue-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaanV2%2Fqueue-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaanV2%2Fqueue-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DaanV2","download_url":"https://codeload.github.com/DaanV2/queue-processor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaanV2%2Fqueue-processor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273782459,"owners_count":25167130,"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-09-05T02:00:09.113Z","response_time":402,"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":["event","eventloop","js","npm","processor","queue","ts"],"created_at":"2025-01-08T18:54:34.791Z","updated_at":"2026-03-01T10:33:05.739Z","avatar_url":"https://github.com/DaanV2.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Queue-Processor\n\nA processor of collections that chunks the items into subsections. Each chunk is scheduled after when the previous chunk or item has been processed. This allows other workflows or scheduled work to execute before continuing on a large dataset. These processors try to keep the event loop as clean as possible. \n\n[![npm-publish](https://github.com/DaanV2/queue-processor/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/DaanV2/queue-processor/actions/workflows/npm-publish.yml)\n[![npm-test](https://github.com/DaanV2/queue-processor/actions/workflows/npm-test.yml/badge.svg)](https://github.com/DaanV2/queue-processor/actions/workflows/npm-test.yml)\n[![tagged-release](https://github.com/DaanV2/queue-processor/actions/workflows/tagged-release.yml/badge.svg)](https://github.com/DaanV2/queue-processor/actions/workflows/tagged-release.yml)\n\n## Why would you need this?\n\nI have an extension that takes a ~30 to process a couple of hundred files, summarize them and diagnose problems; this all takes CPU time. While at the same time, I wanted to give priority to smaller and faster takes, in which I needed a library that could ensure that things got chunked into smaller pieces of work. So other smaller tasks could be done in between the large parts.\n\nPros:\n- Faster response times on other tasks/processes as they also get their time to shine.\nCons:\n- Slightly slower. Chunking a process and allowing other tasks to go first determines how long it takes to finish something.\n\n## Example\n\n```ts\n  //The array of items to process\n  const items : T[] = getItems();\n\n  //Processes for each\n  QueueProcessor.forEach(items, (item)=\u003econsole.log(item));\n\n  //Map each item\n  const mapped : U[] = QueueProcessor.map(items, (item)=\u003econvert(item));\n\n  //Filter each item\n  const filtered : T[] = QueueProcessor.filter(items, (item)=\u003eitem === ...);\n\n  //Processes for each, then use the promise to wait for the result\n  QueueProcessor.forEach(items, (item)=\u003econsole.log(item)).then(items=\u003e{...});\n\n  //Async await code\n  const items = await QueueProcessor.forEach(items, (item)=\u003econsole.log(item));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaanv2%2Fqueue-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaanv2%2Fqueue-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaanv2%2Fqueue-processor/lists"}