{"id":15357230,"url":"https://github.com/gera2ld/process-pool","last_synced_at":"2026-05-28T01:31:58.046Z","repository":{"id":77381497,"uuid":"209802791","full_name":"gera2ld/process-pool","owner":"gera2ld","description":"Take advantage of multiple CPU cores in Node.js","archived":false,"fork":false,"pushed_at":"2019-10-04T17:07:52.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-12T00:32:11.695Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gera2ld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-09-20T13:55:44.000Z","updated_at":"2019-10-04T17:07:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"2f83ffd3-02be-4e6d-9283-5b982a1baf6d","html_url":"https://github.com/gera2ld/process-pool","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"47d941c9c6706096d266defb0a95c5d29b99a840"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gera2ld/process-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fprocess-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fprocess-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fprocess-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fprocess-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gera2ld","download_url":"https://codeload.github.com/gera2ld/process-pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fprocess-pool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33590884,"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-05-27T02:00:06.184Z","response_time":53,"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-01T12:34:08.111Z","updated_at":"2026-05-28T01:31:58.031Z","avatar_url":"https://github.com/gera2ld.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @gera2ld/process-pool\n\n![NPM](https://img.shields.io/npm/v/@gera2ld/process-pool.svg)\n![License](https://img.shields.io/npm/l/@gera2ld/process-pool.svg)\n![Downloads](https://img.shields.io/npm/dt/@gera2ld/process-pool.svg)\n\n`process-pool` allows you to do CPU expensive stuff in multiple processes to make use of multiple CPU cores.\n\n## Usage\n\nAssume we have a `main.js` and `worker.js` like this:\n\n```js\n// main.js\nconst Pool = require('@gera2ld/process-pool');\n\n(async () =\u003e {\n  const pool = new Pool(3, `${__dirname}/worker.js`);\n\n  const [result1, result2] = await Promise.all([\n    pool.invoke('add', [1, 2]),\n    pool.invoke('minus', [4, 3]),\n  ]);\n  console.log(result1, result2);\n\n  await pool.destroy();\n})();\n```\n\n```js\n// worker.js\nconst worker = require('@gera2ld/process-pool/lib/worker');\n\nclass Handler {\n  add(a, b) {\n    return a + b;\n  }\n}\n\n// Set a handler with preset methods\nworker.setHandler(new Handler());\n\n// Add other methods\nworker.setMethod('minus', (a, b) =\u003e a - b);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgera2ld%2Fprocess-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgera2ld%2Fprocess-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgera2ld%2Fprocess-pool/lists"}