{"name":"child-process-promise","version":"0.1.0","description":"Simple wrapper around the \"child_process\" module that makes use of promises","main":"lib/index.js","scripts":{"test":"node test/test.js"},"repository":{"type":"git","url":"https://github.com/patrick-steele-idem/child-process-promise.git"},"keywords":["child","process","promises"],"author":{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},"license":"BSD","bugs":{"url":"https://github.com/patrick-steele-idem/child-process-promise/issues"},"publishConfig":{"registry":"http://registry.npmjs.org/"},"dependencies":{"q":"~0.9.6"},"_id":"child-process-promise@0.1.0","dist":{"shasum":"43a2a48359e26abb442a085d2325bf00cc58f5cb","tarball":"http://registry-npm.ywwl.com/child-process-promise/download/child-process-promise-0.1.0.tgz","integrity":"sha512-YwigT3OG0Fi93NPg1kYkiaYMowdNAPJi+cICb7a6pCg8WQjY9GitSljQFY5HY5jD33Es99Dxh/DA9ChZa5U82w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEuOBvzjR76KKqlOSb/h/4JCCAnBkru+liGz4dhy3W8YAiEAr3S2e8bo72NpOdi6Z9JfBHeSTw4OBv9D8zrbFQWUT4Y="}],"size":1647,"noattachment":false,"key":"/child-process-promise/-/child-process-promise-0.1.0.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"psteeleidem","email":"psteeleidem@ebay.com"},"maintainers":[{"name":"psteeleidem","email":"psteeleidem@ebay.com"}],"directories":{},"readme":"child-process-promise\n=====================\n\n[![Build Status](https://travis-ci.org/patrick-steele-idem/child-process-promise.svg?branch=master)](https://travis-ci.org/patrick-steele-idem/child-process-promise)\n[![NPM](https://img.shields.io/npm/v/child-process-promise.svg)](https://www.npmjs.com/package/child-process-promise)\n[![Downloads](https://img.shields.io/npm/dm/child-process-promise.svg)](http://npm-stat.com/charts.html?package=child-process-promise)\n\nSimple wrapper around the `child_process` module that makes use of promises\n\n# Installation\n```\nnpm install child-process-promise --save\n```\n\n# Usage\n\n## exec\n```javascript\nvar exec = require('child-process-promise').exec;\n\nexec('echo hello')\n    .then(function (result) {\n        var stdout = result.stdout;\n        var stderr = result.stderr;\n        console.log('stdout: ', stdout);\n        console.log('stderr: ', stderr);\n    })\n    .catch(function (err) {\n        console.error('ERROR: ', err);\n    });\n```\n\n## spawn\n```javascript\nvar spawn = require('child-process-promise').spawn;\n\nvar promise = spawn('echo', ['hello']);\n\nvar childProcess = promise.childProcess;\n\nconsole.log('[spawn] childProcess.pid: ', childProcess.pid);\nchildProcess.stdout.on('data', function (data) {\n    console.log('[spawn] stdout: ', data.toString());\n});\nchildProcess.stderr.on('data', function (data) {\n    console.log('[spawn] stderr: ', data.toString());\n});\n\npromise.then(function () {\n        console.log('[spawn] done!');\n    })\n    .catch(function (err) {\n        console.error('[spawn] ERROR: ', err);\n    });\n```\n### Options\n\n#### capture\nType: `Array`  \nDefault: `[]`\n\nPass an additional `capture` option to buffer the result of `stdout` and/or `stderr`\n\n```javascript\nvar spawn = require('child-process-promise').spawn;\n\nspawn('echo', ['hello'], { capture: [ 'stdout', 'stderr' ]})\n    .then(function (result) {\n        console.log('[spawn] stdout: ', result.stdout.toString());\n    })\n    .catch(function (err) {\n        console.error('[spawn] stderr: ', err.stderr);\n    });\n```\n","publish_time":1375917418529,"_cnpm_publish_time":1375917418529,"dist-tags":{"latest":"2.2.1","v0_2_0-SNAPSHOT":"0.2.0-SNAPSHOT.1389671754086"}}