{"id":20229290,"url":"https://github.com/hisco/process-cluster","last_synced_at":"2026-04-12T14:48:53.888Z","repository":{"id":57330836,"uuid":"135488202","full_name":"hisco/process-cluster","owner":"hisco","description":"Have a forever running nodejs cluster (not only nodejs core cluster module)","archived":false,"fork":false,"pushed_at":"2018-12-07T13:36:48.000Z","size":20,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-25T04:21:02.421Z","etag":null,"topics":["cluster","forever","javascript","node-cluster","nodejs","nodejs-c","process-cluster","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/process-cluster","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/hisco.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}},"created_at":"2018-05-30T19:26:11.000Z","updated_at":"2018-08-10T14:36:50.000Z","dependencies_parsed_at":"2022-09-21T02:22:02.331Z","dependency_job_id":null,"html_url":"https://github.com/hisco/process-cluster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisco%2Fprocess-cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisco%2Fprocess-cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisco%2Fprocess-cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisco%2Fprocess-cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hisco","download_url":"https://codeload.github.com/hisco/process-cluster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241670746,"owners_count":20000458,"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":["cluster","forever","javascript","node-cluster","nodejs","nodejs-c","process-cluster","typescript"],"created_at":"2024-11-14T07:35:09.146Z","updated_at":"2025-12-31T01:04:33.975Z","avatar_url":"https://github.com/hisco.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Process cluster\n\n`process-cluster` will asist you in creating any child process cluster, it uses\n`forever-process` to makes sure that cluster will run forever.\n\n## Features\n  * Fork a child process\n  * Spawn any process\n  * Fork a chile process with node cluster capabilities\n  * To any size of cluster\n  * Cluster will run forever, we use `forever-process` to make sure it does.\n\n## Simple usage\nCreating a cluster of Node cluster module.\nNotice, the with this multiple nodejs process will be able to \"share\"(over IPC) the same port when receiving any net requst such as http.\n\n```js\nconst {ProcessCluster} = require('process-cluster');\nconst cluster = require('cluster');\nconst processCluster = new ProcessCluster({\n    size : 3,\n    fork(){\n        cluster.setupMaster({\n                exec : `${prcessPath}`,\n                args : [ \n                    ...process.argv.slice(2)\n                ]\n            });\n        return cluster.fork();\n    }\n});\nprocessCluster.on('childProcess' , (childProcess)=\u003e{\n    console.log('You can do any operation on `childProcess`');\n});\nprocessCluster.on('childProcessRemoved' , (childProcess)=\u003e{\n    console.log('Removed');\n});\nprocessCluster.start();\n\n```\n\nCreating a cluster of Node process with IPC communication without 'port' sharing.\n```js\nconst {ProcessCluster} = require('process-cluster');\nconst {fork} = require('child_process');\nconst processCluster = new ProcessCluster({\n    size : 3,\n    fork(){\n        return fork(`${prcessPath}`);\n    }\n});\nprocessCluster.on('childProcess' , (childProcess)=\u003e{\n    console.log('You can do any operation on `childProcess`');\n});\nprocessCluster.on('childProcessRemoved' , (childProcess)=\u003e{\n    console.log('Removed');\n});\nprocessCluster.start();\n\n```\n\n### API\nWell, the API is quite simple.\nYou can see this TypeScript declaration.\n\n```ts\ndeclare module ProcessCluster {\n\texport class ProcessCluster extends EventEmitter{\n\t\tconstructor(options : {\n            size : number,\n            fork : ()=\u003eChildProcess\n        });\n\t\tpublic createForkedChild():void;\n\t\tpublic removeForkedChild(child? : any):void;\n\t\tpublic forkToDetination():void;\n\t\tpublic increaseBy(size : number):void;\n\t\tpublic decreaseBy(size : number):void;\n\t\tpublic stop():void;\n\t\tpublic start():void;\n\t}\n}\n```\n\n## License\n\n  [MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhisco%2Fprocess-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhisco%2Fprocess-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhisco%2Fprocess-cluster/lists"}