{"id":49756840,"url":"https://github.com/dekkai-data/workers","last_synced_at":"2026-05-10T22:51:30.403Z","repository":{"id":40814342,"uuid":"277911528","full_name":"dekkai-data/workers","owner":"dekkai-data","description":"Tools to manage workers in browsers, node.js and deno.","archived":false,"fork":false,"pushed_at":"2023-08-06T15:49:17.000Z","size":1608,"stargazers_count":4,"open_issues_count":17,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-03T23:13:10.368Z","etag":null,"topics":["deno","javascript","node-js","web-workers","workers"],"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/dekkai-data.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}},"created_at":"2020-07-07T20:06:27.000Z","updated_at":"2024-03-01T21:03:32.000Z","dependencies_parsed_at":"2025-08-18T04:10:13.092Z","dependency_job_id":null,"html_url":"https://github.com/dekkai-data/workers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dekkai-data/workers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekkai-data%2Fworkers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekkai-data%2Fworkers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekkai-data%2Fworkers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekkai-data%2Fworkers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dekkai-data","download_url":"https://codeload.github.com/dekkai-data/workers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekkai-data%2Fworkers/sbom","scorecard":{"id":332921,"data":{"date":"2025-08-11","repo":{"name":"github.com/dekkai-data/workers","commit":"435c56b7ee54a7ca407b9cecffa84a9678549415"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"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":"Code-Review","score":0,"reason":"Found 1/30 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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/browser.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/dekkai-data/workers/browser.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/browser.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/dekkai-data/workers/browser.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deno.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/dekkai-data/workers/deno.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deno.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/dekkai-data/workers/deno.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/deno.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/dekkai-data/workers/deno.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/dekkai-data/workers/node.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/dekkai-data/workers/node.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/browser.yml:21","Warn: npmCommand not pinned by hash: .github/workflows/deno.yml:26","Warn: npmCommand not pinned by hash: .github/workflows/node.yml:21","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   3 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/browser.yml:1","Warn: no topLevel permission defined: .github/workflows/deno.yml:1","Warn: no topLevel permission defined: .github/workflows/node.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":"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":"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 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"}},{"name":"Vulnerabilities","score":0,"reason":"62 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-j4f2-536g-r55m","Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-7x7c-qm48-pq9c","Warn: Project is vulnerable to: GHSA-rc3x-jf5g-xvc5","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q","Warn: Project is vulnerable to: GHSA-4r62-v4vq-hr96","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-6fx8-h7jm-663j","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-fxwf-4rqh-v8g3","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-xfhh-g9f5-x4m4","Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v","Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx","Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-72mh-269x-7mh5","Warn: Project is vulnerable to: GHSA-h4j5-c7cj-74xg","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T04:00:07.780Z","repository_id":40814342,"created_at":"2025-08-18T04:00:07.780Z","updated_at":"2025-08-18T04:00:07.780Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32874700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"ssl_error","status_checked_at":"2026-05-10T13:40:02.145Z","response_time":54,"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":["deno","javascript","node-js","web-workers","workers"],"created_at":"2026-05-10T22:51:29.299Z","updated_at":"2026-05-10T22:51:30.383Z","avatar_url":"https://github.com/dekkai-data.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![@dekkai/workers](https://raw.githubusercontent.com/dekkai-data/assets/master/svg/dekkai_workers_banner_light.svg)  \n![browser](https://github.com/dekkai-data/workers/workflows/browser/badge.svg)\n![node](https://github.com/dekkai-data/workers/workflows/node/badge.svg)\n![deno](https://github.com/dekkai-data/workers/workflows/deno/badge.svg)\n![opinion](https://img.shields.io/badge/badges_are-meaningless-blue)\n\n\u003c/div\u003e\n\n# @dekkai/workers \n\nWorker tools to manage workers in browsers, node.js and deno.\n\nProvides a minimum common API between all the platforms through wrappers:\n\n- **WorkerWrapper:** Wraps a worker and exposes `addEventListenr`/`removeEventListener`, `on`/`off` and utility functions.\n- **WorkerSelf:** Wraps the `self` interface to expose the same API on all platforms.\n- **WorkerInterface:** Provides an interface to wrap objects in workers and handle messaging with the main thread.\n- **WorkerPool:** Class to schedule tasks and handling messages with multiple workers.\n- **envNodeJS:** Utility functions to detect node and handle loading CommonJS (`require`) and ES Modules (`import`).\n\nCheck out the full [API Documentation](https://dekkai-data.github.io/workers/)\n\n## Installation\n\n**Browser/NodeJS**\n```shell script\n$ yarn add @dekkai/workers\n```\n\n**Deno**\n```javascript\n// import from directly from a CDN, like unpkg.com\nimport {WorkerPool} from 'https://unpkg.com/@dekkai/workers';\n```\n\n## Usage\n\n**Create a task executor in your worker code**\n```javascript\n// simple.worker.js\n\n// import WorkerInterface\nimport {WorkerInterface} from '@dekkai/workers';\n\n// create an object (can be a class) that will perform the worker tasks.\n// Each function in the object will be registered as a task.\n// Tasks must return a TaskResult object:\n// export interface TaskResult\u003cT\u003e {\n//     result: T;\n//     transfer?: ArrayBuffer[];\n// }\nclass MyTaskExecutor {\n    ping() {\n        return { result: 'pong' };\n    }\n}\n\n// register the object as a task executor\nWorkerInterface.addTaskExecutor(new MyTaskExecutor());\n```\n\n**Use a `WorkerPool` in your main thread**\n```javascript\n// main.js\n\n// import WorkerPool and optionally WorkerWrapper \nimport {WorkerPool, WorkerWrapper} from '@dekkai/workers';\n\n// create some workers\n// in the browser:\nconst worker = new Worker('./simple.worker.js', { type: 'module' });\n// in node: import worker_threads from  'worker_threads';\nconst worker = new worker_threads.Worker('./simple.worker.js');\n// in deno\nconst worker = new Worker(new URL('./simple.worker.js', import.meta.url), { type: 'module' });\n// or use the convenience function in the WorkerWrapper class\nconst worker = await WorkerWrapper.createWorker('./simple.worker.js', { type: 'module' });\n\n// initialize a worker pool\n// workers can be added when constructing the pool\nconst pool = new WorkerPool([worker1, worker2, ...]);\n// after the pool is initialized as an array\npool.addWorkers([worker1, worker2, ...]);\n// or one by one\npool.addWorker(worker);\n\n// create a task to execute\nconst task = pool.makeTask('ping');\n\n// schedule the task\n// you can `await` for the result\nconst result = await pool.scheduleTask(task);\nassert(result === 'pong');\n// or you can handle the result later using promises\npool.scheduleTask(task).then(result =\u003e assert(result === 'pong'));\n```\n\nCheck out the full [API Documentation](https://dekkai-data.github.io/workers/)\n\n## Deno notes\n\nUnfortunately the Worker API in deno is incomplete, and the full API will not be operational\nuntil the following bug is resolved:\nhttps://github.com/denoland/deno/issues/3557\n\nThe current status of deno tests is:\n```\n  WorkerWrapper\n    ✓ should be able to wrap a worker for the platform\n    ✓ returns the original worker through its `worker` property\n    ✓ can instantiate workers for the platform at runtime\n    ✓ wraps the `postMessage` interface\n    ✓ listens to events using the `on` method\n    ✓ listens to events using the `addEventListener` method\n    ✓ removes listeners using the `off` method\n    ✓ removes listeners using the `removeEventListener` method\n    ✓ invalidates its internal worker when `terminate` is called\n\n  WorkerSelf\n    ✓ returns the original context through the `self` property\n    ✓ can listen to messages using the `on` API\n    ✓ can listen to messages using the `addEventListener` API\n    ✓ removes listeners using the `off` API\n    ✓ removes listeners using the `removeEventListener` API\n    ✓ can post messages using `postMessage`\n\n  WorkerInterface\n    ✓ can add and forward commands to a task executor object\n    ✓ raises an error on unknown tasks\n    ✓ can remove task executor objects and ignores messages when empty\n    ✓ can add and forward messages to multiple executors\n    ✓ properly forwards arguments to tasks\n    1) receives transferred objects and transfers objects back\n\n  WorkerPool\n    ✓ can be constructed with an array of workers\n    ✓ returns its worker count through the `workerCount` property\n    ✓ can add new worker one by one\n    ✓ can add multiple workers at once\n    ✓ wraps its workers\n    2) schedules a task without arguments\n    3) schedules a task with arguments\n    4) can schedule an init task when adding a worker\n    5) handles objects marked for transfer in tasks\n    6) schedules an array of tasks\n    7) schedules tasks in multiple workers simultaneously\n    8) correctly reports if tasks are running\n    9) cancels all pending tasks\n    10) cancels pending tasks with a specific id\n    ✓ can kill all its workers\n\n  API\n    11) executes an init task when workers are added\n    12) executes tasks simultaneously\n    13) can queue more tasks than workers in the pool\n    ✓ can kill all of its workers\n    14) properly transfers objects both ways\n\n\n  27 passing (8s)\n  14 failing\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdekkai-data%2Fworkers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdekkai-data%2Fworkers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdekkai-data%2Fworkers/lists"}