{"name":"child-process-promise","description":"Simple wrapper around the \"child_process\" module that makes use of promises","main":"./index.js","files":["lib","Readme.md"],"scripts":{"lint":"eslint lib/*js test/*js","test":"npm run mocha","mocha":"mocha --ui bdd --reporter spec ./test/","prepublish":"babel lib --out-dir lib-es5"},"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":{"node-version":"^1.0.0","promise-polyfill":"^6.0.1"},"devDependencies":{"babel-cli":"^6.11.4","babel-plugin-check-es2015-constants":"^6.8.0","babel-plugin-transform-es2015-block-scoping":"^6.10.1","babel-preset-es2015":"^6.13.2","chai":"^3.5.0","eslint":"^0.10.2","jshint":"^2.9.1","mocha":"^2.4.5"},"version":"2.1.0","babel":{"presets":["es2015"],"plugins":["check-es2015-constants","transform-es2015-block-scoping"]},"gitHead":"6bf1802f902a712b4522df805089f72f61e28fe3","homepage":"https://github.com/patrick-steele-idem/child-process-promise#readme","_id":"child-process-promise@2.1.0","_shasum":"755388b193cd7d39cb7efc68c5975faa923aa7a6","_from":".","_npmVersion":"2.15.0","_nodeVersion":"0.10.44","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"755388b193cd7d39cb7efc68c5975faa923aa7a6","tarball":"http://registry-npm.ywwl.com/child-process-promise/download/child-process-promise-2.1.0.tgz","integrity":"sha512-0tUW9B7zR/Jh73aLD/5r01Z0KLSfXv6jY6LxBCVAnGbw+HLBn7o1+ozmS4XJHTLTcxf+VW4+ZSpGNtWtuVthng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0EcvG62gVe474KZQr1VGqQSy8AoXD4aaB1gT2l2dBYAIhAJow5V9LBMaNQ6GLSH0958vxzelFBqiNNA0QdYYRMCVC"}],"size":4352,"noattachment":false,"key":"/child-process-promise/-/child-process-promise-2.1.0.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.1.0.tgz_1470974171547_0.6299855154938996"},"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":1470974172834,"_cnpm_publish_time":1470974172834,"dist-tags":{"latest":"2.2.1","v0_2_0-SNAPSHOT":"0.2.0-SNAPSHOT.1389671754086"}}