{"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","test":"npm run mocha","mocha":"mocha --ui bdd --reporter spec ./test/"},"repository":{"type":"git","url":"git+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":{},"devDependencies":{"chai":"^3.5.0","eslint":"^0.10.2","jshint":"^2.9.1","mocha":"^2.4.5"},"version":"2.0.2","engines":{"node":">=4"},"gitHead":"4e0d971902cee34f463e7b6f3ce760140cc574ab","homepage":"https://github.com/patrick-steele-idem/child-process-promise#readme","_id":"child-process-promise@2.0.2","_shasum":"bdcc8fbfd1b70ff852ee9eef24d89f1f7569d82d","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"bdcc8fbfd1b70ff852ee9eef24d89f1f7569d82d","tarball":"http://registry-npm.ywwl.com/child-process-promise/download/child-process-promise-2.0.2.tgz","integrity":"sha512-Q0ONVlvJftNOk+qLhNBTKQNAwcAPRA3pavtMRMvbxiRYaOxOgQocgzMSUQFHhPo7uI/vKDZltWbAO4BVtk8xeg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEyfsON2BpjXgGBiTi7NeJT9REw26p84mZ6bb1hYKA3MAiEA3qCoZRcogzkHygfKRzCI/DVdwTcSuCSz9JMePmJd9DI="}],"size":3769,"noattachment":false,"key":"/child-process-promise/-/child-process-promise-2.0.2.tgz"},"maintainers":[{"name":"psteeleidem","email":"psteeleidem@ebay.com"},{"name":"pnidem","email":"pnidem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/child-process-promise-2.0.2.tgz_1462391703745_0.6011455494444817"},"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":1462391705077,"_cnpm_publish_time":1462391705077,"dist-tags":{"latest":"2.2.1","v0_2_0-SNAPSHOT":"0.2.0-SNAPSHOT.1389671754086"}}