{"name":"pfork","version":"0.2.2","keywords":["child_process","fork","process"],"author":{"name":"avenwu","email":"avenwu@vip.qq.com"},"license":"MIT","_id":"pfork@0.2.2","contributors":[],"homepage":"https://github.com/avwo/pfork","bugs":{"url":"https://github.com/avwo/pfork/issues"},"dist":{"shasum":"a03b0d054de95d87c5e93c6969993027be0d289e","tarball":"http://registry-npm.ywwl.com/pfork/download/pfork-0.2.2.tgz","fileCount":7,"integrity":"sha512-99qAlxIYsYLSKPcwN6OdfJfi3LakPEllXHI15Kh+CkyhdGjr5vpj9eR8ixPGqS+NplKLnFmehe7a1P1YM51BZg==","signatures":[{"sig":"MEUCIQDv1bMyLRBvRCP1nmQ0g2WywJ/dlEeMegXDIWvaiWRwJQIgN+UUQb+lHzlSB+WdYHpb2B7pGR/Xz9e8cJwtLWTwi5k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7TNBCRA9TVsSAnZWagAA2twQAIMpvCOS9juS3qgtU3JP\nhIWn5FTNSDJQPPYhzdPYZTK+I63Z0rPOLCnrXnJbcpl1Ij/m/PpM9dWsssdF\ngodqN3czLKvM6KQ2qnePBPIUYOBYnE8yi9m4weETCPC/91ucSd/1G2JXxsiA\nS8vYV+OmknXsjgcdf29TZfjEos9IBboCzqk+/D7LuFajk9BSLO7khO6amzk1\nuWWFkoDC7vrAjNiGni+NRFjNKqGCjh7jKwrRyRCnZ3pWuYFwlnhkwl5mDSuF\n2ug9aijV+uH5bQ5XXYikSKgA9nfq8Gi52uanNWP6hEVwPCyOnbsMA5PWwfmy\nHEpF3xqe5QMzlPfkA6Li5QBlyfDKsxSB7xx4Qlpu0KN83tufGRPCFAvw4K2v\noXq1MacoK9kxED4apkSWn+xhSjpsmpb3KU7mTLbXtCQahV1iKDGEYRtyH3xz\n1NNKTVpGT0vxUHu6p4y7+MSEIup5MxWUlltRO31ZkSHiYZuetsleZm1xgizc\nok7sA3pB5QA2SXUrBScvgRjVSoslK6uKrlKz4i10rWI2WB1hQCU8/aNnDhSE\nhq9LKJl7IlUUPtLfXDvyr3tK/Ftb5SsVe6aVOBjpwgAW/Cs6sOvLpBLsqlZI\nwPPUQntc0gevZSCckiAD1I455Vs7zABUH9jIvd+PmEbxtFIrnc7nohKRr4k7\ntIKc\r\n=M3bu\r\n-----END PGP SIGNATURE-----\r\n","size":3900,"noattachment":false,"key":"/pfork/-/pfork-0.2.2.tgz"},"main":"lib/index.js","engines":{"node":">= 0.10.0"},"gitHead":"aa304ea9f9e6d26a9c9d3bcd2e1cf6fa3e04a316","_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.2_1559049025141_0.28411299252377087","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":1559049025255,"maintainers":[{"name":"avwu","email":"avenwu@vip.qq.com"}],"_cnpm_publish_time":1559049025255,"dist-tags":{"latest":"0.6.3"}}