{"name":"child-process-promise","description":"Simple wrapper around the \"child_process\" module that makes use of promises","main":"lib/index.js","files":["lib","Readme.md"],"scripts":{"lint":"eslint lib/*js test/*js","pretest":"npm run lint","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":"^1.1.2"},"devDependencies":{"eslint":"^0.10.2"},"version":"1.1.0","gitHead":"5037236af17eadccfb7120b6eb2669ed8cb5a339","homepage":"https://github.com/patrick-steele-idem/child-process-promise","_id":"child-process-promise@1.1.0","_shasum":"131e01a705f15ed4a05d554dd5e032e52612cf30","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"maintainers":[{"name":"psteeleidem","email":"psteeleidem@ebay.com"},{"name":"pnidem","email":"pnidem@gmail.com"}],"dist":{"shasum":"131e01a705f15ed4a05d554dd5e032e52612cf30","tarball":"http://registry-npm.ywwl.com/child-process-promise/download/child-process-promise-1.1.0.tgz","integrity":"sha512-bjobS4PGjYQE7zvj/krKxCWqhJP4OickIz0kQCsiPabWE+HysbbIqKQOXrqSKffznD4Eg3uwYPAnfkYjF/or8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBjGo7UUE3JhykbTN2s9SQg1bwBAuKK+OTl2DlAqzJraAiAz2fvxw4NOLvh7T+2RXOt8EoJdLwhN0Fj9ZSV1FnDN1g=="}],"size":2622,"noattachment":false,"key":"/child-process-promise/-/child-process-promise-1.1.0.tgz"},"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":1431713049352,"_cnpm_publish_time":1431713049352,"dist-tags":{"latest":"2.2.1","v0_2_0-SNAPSHOT":"0.2.0-SNAPSHOT.1389671754086"}}