{"_id":"@2o3t/process-manager","_rev":"2-c5dd9f7663e73e732d3760d5696c11ea","name":"@2o3t/process-manager","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@2o3t/process-manager","version":"0.0.1","description":"","main":"index.js","directories":{"lib":"lib"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"zyao89","email":"zyao89@gmail.com"},"license":"ISC","devDependencies":{"eslint":"^5.16.0","eslint-config-2o3t":"^1.1.15"},"_id":"@2o3t/process-manager@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"zyao89","email":"305161066@qq.com"},"dist":{"integrity":"sha512-9Xvj+w7BXP1UKrPZmt17GNqJDM0MV7w2o2a8pm0xebDY8AnIY0cyeaT3MfY1xJwEEy6ThLA7304kw32LNCjeuw==","shasum":"c70d1be0539b00240a949fbe344e5f87189d0bfc","tarball":"https://registry.npmjs.org/@2o3t/process-manager/-/process-manager-0.0.1.tgz","fileCount":19,"unpackedSize":32300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdURm5CRA9TVsSAnZWagAASFsP/A3lQliCp4QGwlmfZ1DP\n+jTW4wpKcEztHwY71tqlpr2SNCQDGMurGtULdQe1V8g5vIbQg6IxZ0SNTotS\nrg5RJW4EJ6w3+W1SaIq2nsDu4yc9vwp/hoEF7aVmUVTkSi9o1pE9fhetC2jV\nxppiGCIVwwNqWi720E712RGrzd1q3QWz++Yq5oMAWs1+xOFt2zIp1C0ngRJ5\nMh7MkejWhCVvFV6whzcq3LI6YMG5Lm5SjjNFtNRCud3DuTsZFA8CHzS5QL9u\nz9sZPjA/GvI+4/31GPH1fn7WND0OORitCbbGDh1HeZ8ksB7Tp5SZ//9/Ko30\nAgDAPwYROi5A9zltWlisAfffB1cx3pa9Ov0xL+N3tjbVg5Vb8tEXeTTBuGv8\nS+GN+cX/zkMdyBc3zkBp7WDkZJu7VLThsgowKRLuoJUx9JRiFIKWVpXzTNop\n/7BGWQJ15F/6s15WfDf5McAtpbvVAIK5pk731yMNaFPaHlX4niefDrqaBjV+\nNqaIIHl77RXHGm43/8EYzBeBiXr0tZ23dgAqvVMSeSusOqWjMvDVytVKdsJ1\nQjHJotJmeVgb+CEWRA/BRrhd06xbrKgxRZkJEa4FyX0NGjOYNJebiIh+U4GR\n+OcHyGj1Ocit4/PeEFYrmuzjrR8q2W9EBsU6l4ru2LNpXpii9vQY92gqIGXF\nH5Ug\r\n=7mfZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7749Uc18G0K76272e6AtxGbUZvk1jSFd8NHs0HwkpQQIhAK0oMhvaPAIXot/oMaRG2ai0+e3QYVLDG40W9FG2VbNL"}]},"maintainers":[{"name":"zyao89","email":"305161066@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/process-manager_0.0.1_1565596089081_0.27174924802553724"},"_hasShrinkwrap":false},"0.0.2":{"name":"@2o3t/process-manager","version":"0.0.2","description":"Process manager for Nodejs.","main":"index.js","directories":{"lib":"lib"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["process","manager","pm","process-manager","ipc"],"author":{"name":"zyao89","email":"zyao89@gmail.com"},"license":"MIT","homepage":"https://github.com/2o3t/process-manager","repository":{"type":"git","url":"git+https://github.com/2o3t/process-manager.git"},"bugs":{"url":"https://github.com/2o3t/process-manager/issues"},"engines":{"node":">=6"},"devDependencies":{"eslint":"^5.16.0","eslint-config-2o3t":"^1.1.15"},"gitHead":"0f141a0b8c0d1d555666d0b01700711cd6c0f825","_id":"@2o3t/process-manager@0.0.2","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"zyao89","email":"305161066@qq.com"},"dist":{"integrity":"sha512-HU4i4frYV9TLHLdO+6yH0oTa7YwtjaUO7WCLWG1CbmHKXA+MthAdmFVO8CNymlk8CUO2z9gkgRnzKrxYR1SodQ==","shasum":"a78658eebbbd05c2fbaf7004ec90f57afd0c2e72","tarball":"https://registry.npmjs.org/@2o3t/process-manager/-/process-manager-0.0.2.tgz","fileCount":16,"unpackedSize":33884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdUSJPCRA9TVsSAnZWagAAufcP/1tb5d9EMSbUKYaZdHK/\nR5g4JCvo1aHaYvJcEWv7F/BFgIo9CWQXEZ36UHDctoamaaVobc0P3PEQ8vmO\nDavukk7/LkzENRMtjjtddRr0pJuEdQJJShirvx7h4YN1ajkAAfzpzNGNFDBn\nqFljy5KGCKhICRnRy9HxBv/3KPR0GlYqivcPEeuZUbWGXE2d9TFSq65UgAgH\n6oOKhvYuhdDBB+3q4tZ0BNTiACQCIDdlgEeTypilGaYM13YvqbBTYGJC7t8q\nISbbsGPnTa0DLBldRiK5lMkTYRiKTpbZGeMzOKrqi9Rzd43oCwFel6YvQnjm\n81KFA+2QAzYtwmi22nSYzZZzxgH26gwzpHpZob+O3nDhu6psmeJ5FzxeTsf3\nX8UKLztc+D0JheAv3LMApkRkEJ+lk1jGS0xxTyxgoZNw7cxRU5U7uYC9AmV6\n3eZ3/UIL8eMdo6gLx+YooMjMY+1+FIDrNdAm4uTTuCbzabK3d7kG84fdE2P2\nlGst7l3B1LOmDoRwtoEJRPkkOuhb3Wb5AgqzVx7buLCttIxH7v5VKoQxFY8s\n5msv8CdAJNAmE4bw/qXBIv3+16YH1KES9BMYQJGbs8q3R8MZ5m0Y4vsYSHP3\nf9NaQL8SRhiZVQf0jiDX8koQSiUPvMG7OFHLTFYnCDUTdpYi9C9NiZ6KzX4B\n95wh\r\n=t2xT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFj2Xu4/zlUqEjadwmcbNXl4MJnfTArWmslMv04wIt4/AiAQXZy+QY/4Qi8vfi3Nsk6Xctce/WddddRdbeDgXQjArg=="}]},"maintainers":[{"name":"zyao89","email":"305161066@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/process-manager_0.0.2_1565598287293_0.2547814329883944"},"_hasShrinkwrap":false}},"time":{"created":"2019-08-12T07:48:08.914Z","0.0.1":"2019-08-12T07:48:09.218Z","modified":"2022-04-04T10:42:52.904Z","0.0.2":"2019-08-12T08:24:47.464Z"},"maintainers":[{"name":"zyao89","email":"305161066@qq.com"}],"author":{"name":"zyao89","email":"zyao89@gmail.com"},"license":"MIT","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 => {\n    console.log('data', data);\n});\nchannel.listen('ccc')(aa => {\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 <br> * Allows to pass in fresh execArgv to the forked process such that it doesn't inherit them from `process.execArgv`. <br> * 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","readmeFilename":"README.MD","description":"Process manager for Nodejs.","homepage":"https://github.com/2o3t/process-manager","keywords":["process","manager","pm","process-manager","ipc"],"repository":{"type":"git","url":"git+https://github.com/2o3t/process-manager.git"},"bugs":{"url":"https://github.com/2o3t/process-manager/issues"}}