{"_id":"childprocess","_rev":"1212283","name":"childprocess","description":"Wrap `child_process` module to support Multiple Process Code Coverage with istanbul.","dist-tags":{"latest":"2.0.2"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"time":{"modified":"2021-10-13T05:45:56.000Z","created":"2015-08-30T09:52:24.516Z","2.0.2":"2016-06-20T14:28:35.510Z","2.0.1":"2016-02-24T19:02:05.237Z","2.0.0":"2015-10-31T01:57:31.190Z","1.0.3":"2015-10-29T01:57:33.674Z","1.0.2":"2015-09-01T08:51:20.133Z","1.0.1":"2015-09-01T08:35:00.293Z","1.0.0":"2015-08-30T09:52:24.516Z"},"users":{"tujiaw":true},"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"repository":{"type":"git","url":"git://github.com/node-modules/childprocess.git","web":"https://github.com/node-modules/childprocess"},"versions":{"2.0.2":{"name":"childprocess","version":"2.0.2","description":"Wrap `child_process` module to support Multiple Process Code Coverage with istanbul.","main":"index.js","files":["index.js"],"scripts":{"cover":"istanbul cover --include-all-sources --report none --print none node_modules/mocha/bin/_mocha -- --check-leaks -t 50000 test/*.test.js","lint":"eslint index.js fixtures test","test":"npm run clean && npm run lint && npm run cover && istanbul report --root coverage json lcov html text","autod":"autod -w --prefix '~'","clean":"rm -rf coverage"},"dependencies":{"utility":"~1.6.0"},"devDependencies":{"autod":"*","coffee":"1","eslint":"1","istanbul":"*","mm":"1","mocha":"*","pedding":"1","spy":"~0.1.3"},"homepage":"https://github.com/node-modules/childprocess","repository":{"type":"git","url":"git://github.com/node-modules/childprocess.git","web":"https://github.com/node-modules/childprocess"},"bugs":{"url":"https://github.com/node-modules/childprocess/issues","email":"m@fengmk2.com"},"keywords":["childprocess","child_process","multiple_process","istanbul","coverage","cov","codecov"],"engines":{"node":">=0.12.0"},"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"license":"MIT","contributors":[{"name":"fengmk2","email":"m@fengmk2.com","url":"https://fengmk2.com"}],"gitHead":"caed1ee042849f4aeb3b41f68b5186fe8b3a4cdc","_id":"childprocess@2.0.2","_shasum":"3d684929748b1e13e8521cf619bde5440de85eb4","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"3d684929748b1e13e8521cf619bde5440de85eb4","size":3497,"noattachment":false,"key":"/childprocess/-/childprocess-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/childprocess/download/childprocess-2.0.2.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/childprocess-2.0.2.tgz_1466432913360_0.9550363379530609"},"directories":{},"publish_time":1466432915510,"_cnpm_publish_time":1466432915510,"_hasShrinkwrap":false},"2.0.1":{"name":"childprocess","version":"2.0.1","description":"Wrap `child_process` module to support Multiple Process Code Coverage with istanbul.","main":"index.js","files":["index.js"],"scripts":{"cover":"istanbul cover --include-all-sources --report none --print none node_modules/mocha/bin/_mocha -- --check-leaks -t 50000 test/*.test.js","lint":"eslint index.js fixtures test","test":"npm run clean && npm run lint && npm run cover && istanbul report --root coverage json lcov html text","autod":"autod -w --prefix '~'","clean":"rm -rf coverage"},"dependencies":{"utility":"~1.6.0"},"devDependencies":{"autod":"*","coffee":"1","eslint":"1","istanbul":"*","mm":"1","mocha":"*","pedding":"1","spy":"~0.1.3"},"homepage":"https://github.com/node-modules/childprocess","repository":{"type":"git","url":"git://github.com/node-modules/childprocess.git","web":"https://github.com/node-modules/childprocess"},"bugs":{"url":"https://github.com/node-modules/childprocess/issues","email":"m@fengmk2.com"},"keywords":["childprocess","child_process","multiple_process","istanbul","coverage","cov","codecov"],"engines":{"node":">=0.12.0"},"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"license":"MIT","contributors":[{"name":"fengmk2","email":"m@fengmk2.com","url":"https://fengmk2.com"}],"gitHead":"327d0082c796626d4ecd62cb0bf6f5532bc3dd46","_id":"childprocess@2.0.1","_shasum":"2f4cdbbb3b23b46c77001fae75d7cde79a27e0ac","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"2f4cdbbb3b23b46c77001fae75d7cde79a27e0ac","size":3352,"noattachment":false,"key":"/childprocess/-/childprocess-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/childprocess/download/childprocess-2.0.1.tgz"},"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/childprocess-2.0.1.tgz_1456340523857_0.22626287559978664"},"directories":{},"publish_time":1456340525237,"_cnpm_publish_time":1456340525237,"_hasShrinkwrap":false},"2.0.0":{"name":"childprocess","version":"2.0.0","description":"Wrap `child_process` module to support Multiple Process Code Coverage with istanbul.","main":"index.js","files":["index.js"],"scripts":{"cover":"istanbul cover --include-all-sources --report none --print none _mocha -- --check-leaks -t 50000 test/*.test.js","lint":"eslint index.js fixtures test","test":"npm run clean && npm run lint && npm run cover && istanbul report --root coverage json lcov html text","autod":"autod -w --prefix '~'","clean":"rm -rf coverage"},"dependencies":{},"devDependencies":{"autod":"*","coffee":"~1.3.1","eslint":"1","istanbul":"*","mm":"^1.3.0","mocha":"*","pedding":"^1.0.0","spy":"~0.1.3"},"homepage":"https://github.com/node-modules/childprocess","repository":{"type":"git","url":"git://github.com/node-modules/childprocess.git","web":"https://github.com/node-modules/childprocess"},"bugs":{"url":"https://github.com/node-modules/childprocess/issues","email":"m@fengmk2.com"},"keywords":["childprocess","child_process","multiple_process","istanbul","coverage","cov","codecov"],"engines":{"node":">=0.12.0"},"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"license":"MIT","contributors":[{"name":"fengmk2","email":"m@fengmk2.com","url":"https://fengmk2.com"}],"gitHead":"1037fd12fe0e1f02252a28c49ffb721395df5860","_id":"childprocess@2.0.0","_shasum":"0f844e12954c550472fed9e092130ec75e2996bc","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"0f844e12954c550472fed9e092130ec75e2996bc","size":3157,"noattachment":false,"key":"/childprocess/-/childprocess-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/childprocess/download/childprocess-2.0.0.tgz"},"directories":{},"publish_time":1446256651190,"_cnpm_publish_time":1446256651190,"_hasShrinkwrap":false},"1.0.3":{"name":"childprocess","version":"1.0.3","description":"Wrap `child_process` module to support Multiple Process Code Coverage with istanbul.","main":"index.js","files":["index.js"],"scripts":{"cover":"istanbul cover --include-all-sources --report none --print none _mocha -- --check-leaks -t 5000 test/*.test.js","lint":"eslint index.js fixtures test","test":"npm run clean && npm run lint && npm run cover && istanbul report json lcov html text","autod":"autod -w --prefix '~'","clean":"rm -rf coverage"},"dependencies":{},"devDependencies":{"autod":"*","eslint":"1","istanbul":"*","mm":"^1.3.0","mocha":"*","pedding":"^1.0.0"},"homepage":"https://github.com/node-modules/childprocess","repository":{"type":"git","url":"git://github.com/node-modules/childprocess.git","web":"https://github.com/node-modules/childprocess"},"bugs":{"url":"https://github.com/node-modules/childprocess/issues","email":"m@fengmk2.com"},"keywords":["childprocess","child_process","multiple_process","istanbul","coverage","cov","codecov"],"engines":{"node":">=0.12.0"},"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"license":"MIT","contributors":[{"name":"fengmk2","email":"m@fengmk2.com","url":"https://fengmk2.com"}],"gitHead":"76f076ae737c588d869e4e212c12fbfa8ab65a05","_id":"childprocess@1.0.3","_shasum":"f0467073ac4118c9b70e121fa7f52002b6f42e34","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"f0467073ac4118c9b70e121fa7f52002b6f42e34","size":2498,"noattachment":false,"key":"/childprocess/-/childprocess-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/childprocess/download/childprocess-1.0.3.tgz"},"directories":{},"publish_time":1446083853674,"_cnpm_publish_time":1446083853674,"_hasShrinkwrap":false},"1.0.2":{"name":"childprocess","version":"1.0.2","description":"Wrap `child_process` module to support Multiple Process Code Coverage with istanbul.","main":"index.js","files":["index.js"],"scripts":{"cover":"istanbul cover --include-all-sources --report none --print none node_modules/.bin/_mocha -- --check-leaks -t 5000 test/*.test.js","lint":"eslint index.js fixtures test","test":"npm run clean && npm run lint && npm run cover && istanbul report json lcov html text","autod":"autod -w --prefix '~'","cnpm":"npm install --registry=https://registry.npm.taobao.org","clean":"rm -rf coverage"},"dependencies":{},"devDependencies":{"autod":"*","eslint":"1","istanbul":"*","mm":"^1.3.0","mocha":"*"},"homepage":"https://github.com/node-modules/childprocess","repository":{"type":"git","url":"git://github.com/node-modules/childprocess.git","web":"https://github.com/node-modules/childprocess"},"bugs":{"url":"https://github.com/node-modules/childprocess/issues","email":"m@fengmk2.com"},"keywords":["childprocess","child_process","multiple_process","istanbul","coverage","cov","codecov"],"engines":{"node":">=0.12.0"},"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"license":"MIT","contributors":[{"name":"fengmk2","email":"m@fengmk2.com","url":"https://fengmk2.com"}],"gitHead":"df28adf0a60667736a3e9358ae8c782a013724fc","_id":"childprocess@1.0.2","_shasum":"3057909f8a78d9b8d7c5cde4ae4eb329a6cf55bd","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"3057909f8a78d9b8d7c5cde4ae4eb329a6cf55bd","size":2476,"noattachment":false,"key":"/childprocess/-/childprocess-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/childprocess/download/childprocess-1.0.2.tgz"},"directories":{},"publish_time":1441097480133,"_cnpm_publish_time":1441097480133,"_hasShrinkwrap":false},"1.0.1":{"name":"childprocess","version":"1.0.1","description":"Wrap `child_process` module to support Multiple Process Code Coverage with istanbul.","main":"index.js","files":["index.js"],"scripts":{"cover":"istanbul cover --include-all-sources --report none --print none node_modules/.bin/_mocha -- --check-leaks -t 5000 test/*.test.js","lint":"eslint index.js fixtures test","test":"npm run clean && npm run lint && npm run cover && istanbul report json lcov html text","autod":"autod -w --prefix '~'","cnpm":"npm install --registry=https://registry.npm.taobao.org","clean":"rm -rf coverage"},"dependencies":{},"devDependencies":{"autod":"*","eslint":"1","istanbul":"*","mm":"^1.3.0","mocha":"*"},"homepage":"https://github.com/node-modules/childprocess","repository":{"type":"git","url":"git://github.com/node-modules/childprocess.git","web":"https://github.com/node-modules/childprocess"},"bugs":{"url":"https://github.com/node-modules/childprocess/issues","email":"m@fengmk2.com"},"keywords":["childprocess","child_process","multiple_process","istanbul","coverage","cov","codecov"],"engines":{"iojs":">=1.0.0"},"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"license":"MIT","contributors":[{"name":"fengmk2","email":"m@fengmk2.com","url":"https://fengmk2.com"}],"gitHead":"366ece617053f2d22bc38e85a13a9b07b6c37382","_id":"childprocess@1.0.1","_shasum":"2c494594276c6c45ce7721138469d6a6fc2fadb1","_from":".","_npmVersion":"2.13.2","_nodeVersion":"2.5.3","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"2c494594276c6c45ce7721138469d6a6fc2fadb1","size":2464,"noattachment":false,"key":"/childprocess/-/childprocess-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/childprocess/download/childprocess-1.0.1.tgz"},"directories":{},"publish_time":1441096500293,"_cnpm_publish_time":1441096500293,"_hasShrinkwrap":false},"1.0.0":{"name":"childprocess","version":"1.0.0","description":"Wrap `child_process` module to support Multiple Process Code Coverage with istanbul.","main":"index.js","files":["index.js"],"scripts":{"cover":"istanbul cover --include-all-sources --report none --print none node_modules/.bin/_mocha -- --check-leaks -t 5000 test/*.test.js","lint":"eslint index.js fixtures test","test":"npm run clean && npm run lint && npm run cover && istanbul report json lcov html text","autod":"autod -w --prefix '~'","cnpm":"npm install --registry=https://registry.npm.taobao.org","clean":"rm -rf coverage"},"dependencies":{},"devDependencies":{"autod":"*","eslint":"1","istanbul":"*","mm":"^1.3.0","mocha":"*"},"homepage":"https://github.com/node-modules/childprocess","repository":{"type":"git","url":"git://github.com/node-modules/childprocess.git","web":"https://github.com/node-modules/childprocess"},"bugs":{"url":"https://github.com/node-modules/childprocess/issues","email":"m@fengmk2.com"},"keywords":["childprocess","child_process","multiple_process","istanbul","coverage","cov","codecov"],"engines":{"iojs":">=1.0.0"},"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"license":"MIT","contributors":[{"name":"fengmk2","email":"m@fengmk2.com","url":"https://fengmk2.com"}],"gitHead":"38f19075fb4292585ae242e6b5796b11f49c0186","_id":"childprocess@1.0.0","_shasum":"9a74e07e3ff32724795f4d4d6f6083d28b74203f","_from":".","_npmVersion":"2.13.2","_nodeVersion":"2.5.3","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"9a74e07e3ff32724795f4d4d6f6083d28b74203f","size":2346,"noattachment":false,"key":"/childprocess/-/childprocess-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/childprocess/download/childprocess-1.0.0.tgz"},"directories":{},"publish_time":1440928344516,"_cnpm_publish_time":1440928344516,"_hasShrinkwrap":false}},"readme":"childprocess\n=======\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![appveyor build status][appveyor-image]][appveyor-url]\n[![Test coverage][cov-image]][cov-url]\n[![David deps][david-image]][david-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/childprocess.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/childprocess\n[travis-image]: https://img.shields.io/travis/node-modules/childprocess.svg?style=flat-square\n[travis-url]: https://travis-ci.org/node-modules/childprocess\n[appveyor-image]: https://ci.appveyor.com/api/projects/status/aeh1v06b88nb7ok9?svg=true\n[appveyor-url]: https://ci.appveyor.com/project/fengmk2/childprocess\n[cov-image]: https://codecov.io/github/node-modules/childprocess/coverage.svg?branch=master\n[cov-url]: https://codecov.io/github/node-modules/childprocess?branch=master\n[david-image]: https://img.shields.io/david/node-modules/childprocess.svg?style=flat-square\n[david-url]: https://david-dm.org/node-modules/childprocess\n[download-image]: https://img.shields.io/npm/dm/childprocess.svg?style=flat-square\n[download-url]: https://npmjs.org/package/childprocess\n\nInject script into multiple process when using `child_process.fork`.\n\nOne of the use case is [Multiple Process Code Coverage](https://github.com/gotwarlost/istanbul#multiple-process-usage) with [istanbul].\n\n- [cluster code coverage with istanbul](http://fengmk2.com/blog/2015/cluster-coverage/README.html)\n\n## Install\n\n```bash\n$ npm i childprocess\n```\n\n## Usage\n\n```js\nrequire('childprocess').inject(function(modulePath, args, opt) {\n  const execFile = 'path/to/istanbul';\n  const cwd = opt.cwd && process.cwd();\n  const execArgs = [\n    'cover',\n    '--root', cwd,\n    '--dir', path.join(cwd, './coverage'),\n    '--report', 'none',\n    '--print', 'none',\n    '--include-pid',\n    modulePath,\n    '--',\n  ].concat(args);\n  return [execFile, execArgs, opt];\n});\nrequire('child_process').fork();\n```\n\n## APIs\n\n## inject(cb) / inject(filepath)\n\nInject script when using `child_process.fork`.\n\nThe inject script is a function that running in sandbox in every process. that mean you can't use the variable out of the function.\n\nThe function should return an array that contains 3 arguments same as fork.\n\n```js\nchildprocess.inject(function(modulePath, args, opt) {\n  return [modulePath, args, opt];\n});\n```\n\n### reset()\n\nUse `child_process.fork` without injected script.\n\n## License\n\n[MIT](LICENSE)\n\n[istanbul]: https://github.com/gotwarlost/istanbul\n","_attachments":{},"homepage":"https://github.com/node-modules/childprocess","bugs":{"url":"https://github.com/node-modules/childprocess/issues","email":"m@fengmk2.com"},"license":"MIT"}