{"id":21524368,"url":"https://github.com/2o3t/process-manager","last_synced_at":"2026-05-20T06:08:10.936Z","repository":{"id":57093577,"uuid":"201883357","full_name":"2o3t/process-manager","owner":"2o3t","description":"[Library] Process manager for Nodejs","archived":false,"fork":false,"pushed_at":"2019-08-29T17:56:49.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T23:47:23.147Z","etag":null,"topics":["child-process","fork","nodejs","process","process-manager","subprocess"],"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/2o3t.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":"2019-08-12T07:51:24.000Z","updated_at":"2019-08-29T17:56:51.000Z","dependencies_parsed_at":"2022-08-22T21:40:17.740Z","dependency_job_id":null,"html_url":"https://github.com/2o3t/process-manager","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2o3t%2Fprocess-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2o3t%2Fprocess-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2o3t%2Fprocess-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2o3t%2Fprocess-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2o3t","download_url":"https://codeload.github.com/2o3t/process-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244085031,"owners_count":20395523,"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":["child-process","fork","nodejs","process","process-manager","subprocess"],"created_at":"2024-11-24T01:24:30.696Z","updated_at":"2026-05-20T06:08:10.883Z","avatar_url":"https://github.com/2o3t.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @2o3t/process-manager\n\nProcess manager for Nodejs.\n\nIdeas from https://github.com/Microsoft/vscode.\n\n## Installation\n\n```sh\nnpm install @2o3t/process-manager\n```\n\nor\n\n```sh\nyarn add @2o3t/process-manager\n```\n\n## Usage\n\n**Client** (main process):\n\n```js\nconst PM = require('@2o3t/process-manager');\nconst client = new PM.Client(__dirname + '/sub-processes.js');\nconst channel = client.getChannel('channelName');\nchannel.call('info', {\n    // something\n}).then(data =\u003e {\n    console.log('data', data);\n});\nchannel.listen('ccc')(aa =\u003e {\n    console.log('listen..', aa);\n});\n```\n\n\n**Server** (sub process):\n\n```js\nconst PM = require('@2o3t/process-manager');\nconst server = new PM.Server();\nconst channel = new PM.ServerChannel({\n    info(arg) {\n        console.log('arg: ', arg);\n        return Promise.resolve(server.info);\n    },\n    ccc(emit) {\n        emit('100w');\n        emit('101w');\n        // server.dispose();\n        emit('102w');\n        emit('103w');\n        emit('104w');\n    },\n});\nconsole.log('server ok');\nserver.registerChannel('channelName', channel);\n```\n\n## Options\n\n**`Client`** options in paramters\n\n**modulePath**: file path of sub process\n\n**options**: Object.\n\n| key | type | desc |\n|-----|-----|-----|\n| **serverName** | string | A descriptive name for the server this connection is to. Used in logging. |\n| **timeout**? | number | Time in millies before killing the ipc process. The next request after killing will start it again. |\n| **args**? | string[] | Arguments to the module to execute. |\n| **env**? | any | Environment key-value pairs to be passed to the process that gets spawned for the ipc. |\n| **debug**? | number | Allows to assign a debug port for debugging the application executed. |\n| **debugBrk**? | number | Allows to assign a debug port for debugging the application and breaking it on the first line. |\n| **freshExecArgv**? | boolean | See https://github.com/Microsoft/vscode/issues/27665 \u003cbr\u003e * Allows to pass in fresh execArgv to the forked process such that it doesn't inherit them from `process.execArgv`. \u003cbr\u003e * e.g. Launching the extension host process with `--inspect-brk=xxx` and then forking a process from the extension host results in the forked process inheriting `--inspect-brk=xxx`. |\n| **useQueue**? | boolean | Enables our createQueuedSender helper for this Client. Uses a queue when the internal Node.js queue is full of messages - see notes on that method. |\n\n\n\n**`Server`** options in paramters\n\n**options**: Object.\n\n| key | type | desc |\n|-----|-----|-----|\n| **timeoutDelay**? | number | They will timeout after `timeoutDelay`. |\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2o3t%2Fprocess-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2o3t%2Fprocess-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2o3t%2Fprocess-manager/lists"}