{"name":"pfork","version":"0.3.5","keywords":["child_process","fork","process"],"author":{"name":"avenwu","email":"avenwu@vip.qq.com"},"license":"MIT","_id":"pfork@0.3.5","contributors":[],"homepage":"https://github.com/avwo/pfork","bugs":{"url":"https://github.com/avwo/pfork/issues"},"dist":{"shasum":"7ae4090e99de6748973e583cec1cdee495f7ffc1","tarball":"http://registry-npm.ywwl.com/pfork/download/pfork-0.3.5.tgz","fileCount":7,"integrity":"sha512-YYUx5PrgtTW6wRXFD+qSaqmbQuxJmCraudDf1hSxP6gC9EAwx1Bmk7ivQJEVU2mSlY5jbpF5E/s2ASXi3Tikwg==","signatures":[{"sig":"MEYCIQCqtAgoJKztnlObMfnYCkSBXEQpI6m1oaXJZ1RVWzivTgIhAIwXDZ5uQkCompewStBJYkqB/o78GsRtD3IV1ojI2Mra","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10835,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0W8jCRA9TVsSAnZWagAAsgwQAJdOsbvcQieJYWcXrCiH\naclr7/NX7Xr6ecX0YZyxcqIzAnQhXCS/GdHfOZrMP8jZSa/rg3UFo1MVd2G+\nc69aGtIA3xm9RmsLzPsTMcF/jTS+OXdUpuyKVhkY7JDEAUIfnp7mNLmjhUat\nPTCkO7bGRyc1aiRlAfwA7SZ9ivbg3SeFBHeoCy+EH7jGt2WkYlNa0ZmQO1lG\nz9SjL6y10KhiTq1FgpCYYfnxZ7Y8zBbH08vW2ESUXYfYRIFbcwVaZyrQfDAI\nQDbm81KhXu+8ZzT9lPbB+srtzlRaPUaimlG9Xgz/oOCEmPDuKHESjvVOdOCj\nwah8hKeLr6AYcJ9Q7E0JgNUL31fr5mqE4aZ6rVwGpnf/CJoWAHw1k6PpCnFd\ncTfReEvX8+1T6Vb0leXtrdlU9SD/2HzJn6i6JZhhsJ4jqGHfsSUh4Ix9amtR\nsZVc9gk0AzfogmT+Mio5N5qzXGyHudLxFLvHfweYQYl780S/0FgPMQTKvubw\nQTnzlYQVgh85FpCO3Ly7RJ/3xDZhg/KC5rx7Smw5obiAfr+COxCfbadVCT1z\nh2SvOOFU45pwTAxTOrPyV7v40PwJ1+SZpsXPUhAENN8ZOMMBRGH1ybozW2s6\nPi3gUVE4TaG0frt2BWRHh0pu60SfVenPtAsrOuBWpFapAv0jmIg/lPPqnabF\n63ig\r\n=Xpbp\r\n-----END PGP SIGNATURE-----\r\n","size":4008,"noattachment":false,"key":"/pfork/-/pfork-0.3.5.tgz"},"main":"lib/index.js","engines":{"node":">= 0.10.0"},"gitHead":"856fae9fe6dd9a59f9c1db38540042e7a301ffc8","scripts":{"lint":"eslint ./lib index.js","lintfix":"eslint --fix ./lib index.js"},"_npmUser":{"name":"avwu","email":"avenwu@vip.qq.com"},"registry":"http://registry.npmjs.org/pfork","repository":{"url":"git+https://github.com/avwo/pfork.git","type":"git"},"_npmVersion":"6.12.0","description":"fork process","directories":{},"_nodeVersion":"12.13.0","dependencies":{"q":"^1.4.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^2.13.1"},"_npmOperationalInternal":{"tmp":"tmp/pfork_0.3.5_1574006562691_0.45270739245968095","host":"s3://npm-registry-packages"},"readme":"# pfork\n用于在后台运行程序中启动一个进程执行相应的脚本\n\n# Installation\n\n\tnpm install pfork --save\n\t\n# Usage\n\tvar p = require('pfork');\n\tvar options = {\n\t\tscript: '/User/xxx/test/script.js', //必填\n\t\tvalue: '/User/xxx/test/server.js',  //可选\n\t\t//其它字段\n\t};\n\t//会根据script和value自动去重\n\tp.fork(options, function(err, data, child) {\n\t\t//启动结束\n\t\t//child.on('data', function(data) {});\n\t\t//child.sendData(data);\n\t\t//child.on('exit', function() {}); //退出的时候\n\t});\n\t\n/User/xxx/test/script.js\n\n\t//options与fork的options字段一致\n\tmodule.exports = function(options, callback) {\n\t\t//do sth\n\t\t// process.sendData(data);\n\t\tcallback(err, data);\n\t}；\n\t\nkill process：\n\n\tp.kill({\n\t\tscript: '/User/xxx/test/script.js',\n\t\tvalue: '/User/xxx/test/server.js'\n\t});\n\t\n判断进程是否已存在：\n\n\tp.exists({\n\t\tscript: '/User/xxx/test/script.js',\n\t\tvalue: '/User/xxx/test/server.js'\n\t});\n\n\t","publish_time":1574006562860,"maintainers":[{"name":"avwu","email":"avenwu@vip.qq.com"}],"_cnpm_publish_time":1574006562860,"dist-tags":{"latest":"0.6.3"}}