{"name":"pfork","version":"0.2.3","keywords":["child_process","fork","process"],"author":{"name":"avenwu","email":"avenwu@vip.qq.com"},"license":"MIT","_id":"pfork@0.2.3","contributors":[],"homepage":"https://github.com/avwo/pfork","bugs":{"url":"https://github.com/avwo/pfork/issues"},"dist":{"shasum":"ca055126b81b3d766835ed30dc000480b31afabf","tarball":"http://registry-npm.ywwl.com/pfork/download/pfork-0.2.3.tgz","fileCount":7,"integrity":"sha512-uwIOMBTSCs7OCokrPSpmy6xE3JrecFslcyQ+TouT18shmy298hkrnxQuXMcgpfqu45N5yf+r9PKBhggR0WPoyw==","signatures":[{"sig":"MEMCIGEcx610fqSLQ3fv7FufnF71JvhNiW9kIe48WdWdzI9+Ah8kY9Q/Mopj710CF9LIpRWtt1mUTCJYCXfyNlwCVpoL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7UyECRA9TVsSAnZWagAAlrgP/0mFU46bnfdmWrwtM8aK\nVjyM7cUovNAVh5HsVuEiLP7hwnDiAYc0bHsYXW6qhs1RfcCyHXpl+OgeKLiX\npurdGfOLl83LBIwrnPgWh7O6kGzzDojZ7bQzSsbST0xIsbWAsV6NfRSgZKKT\nB6y95nTzKly23bnqgjjV7uhAzOztYxww+1BGvNEpZscqxXtqFkfEhiUcghKr\n9J+nKhodqdWDD23yEh2/YHFJ1dxrBH6aQapCzLfrOCHu2IKTFQAe+XY+LC1J\nUhWsTBTMY98kQhFD43sY+0acn7iv6+/AAxOOhJ/vmqzbXVqeLQ8QWdEXFRvu\n8gBB+/cnKI0a4DPeIcVKQoV0m351GQzh0v2porWD+KjbSoekfJ8RBMYyA0ov\nV+hvU5QS4aowajOcUv5CraeXLoUelSwR7H02thbOhxf1Z+HpSsXQAe9wWoXz\nHVKLYoKNDYC6O4E8HR+RhNSL4Y+lduIAq9uyzIdkr45kg1NZwt2TAh6MCQGw\nomCI/G0iKiupWzj70/+knrvbywOl/m/Z8Pl8OZh6tNI6BQQMEIaWtpjTIRmZ\nYddL1vffGsJich3NqVcChIq8s4An50UB3/hQ3lqPFchfFWkvunwkBQWGv5Oc\n3Ofz60SYcpXY9xuRajmZXZ6qEGhdTaKoHKoN4OKc8jxVqrgW/CqZD52JiMdc\nDFZg\r\n=PR8D\r\n-----END PGP SIGNATURE-----\r\n","size":3959,"noattachment":false,"key":"/pfork/-/pfork-0.2.3.tgz"},"main":"lib/index.js","engines":{"node":">= 0.10.0"},"gitHead":"ec86440880bfa2d8aed603007d031f8793ea0159","_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":"5.0.3","description":"fork process","directories":{},"_nodeVersion":"8.1.4","dependencies":{"q":"^1.4.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pfork_0.2.3_1559055492057_0.6660980962015353","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":1559055492178,"maintainers":[{"name":"avwu","email":"avenwu@vip.qq.com"}],"_cnpm_publish_time":1559055492178,"dist-tags":{"latest":"0.6.3"}}