{"name":"child-process-promise","description":"Simple wrapper around the \"child_process\" module that makes use of promises","main":"./index.js","files":["lib","lib-es5","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":"MIT","bugs":{"url":"https://github.com/patrick-steele-idem/child-process-promise/issues"},"publishConfig":{"registry":"http://registry.npmjs.org/"},"dependencies":{"cross-spawn":"^4.0.2","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.2.0","babel":{"presets":["es2015"],"plugins":["check-es2015-constants","transform-es2015-block-scoping"]},"gitHead":"36c0b8c3e139f2c4b47e05037e9320d9cb78d99d","homepage":"https://github.com/patrick-steele-idem/child-process-promise#readme","_id":"child-process-promise@2.2.0","_shasum":"08f6c9ed7848c770c0a2539cb132f4ce0840a866","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.5.0","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"08f6c9ed7848c770c0a2539cb132f4ce0840a866","tarball":"http://registry-npm.ywwl.com/child-process-promise/download/child-process-promise-2.2.0.tgz","integrity":"sha512-FeG1OIlEhTFROYp6AyM5SYcwEoE5isFC2qb2JLij6dcSaemV95BXBc8Vecw+tD5m8THYWxTKRCFe33nSEpMMZg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID7I26XBk4IO5aCG4zNJUjnP9J8WCx83vIsZC97+WwU2AiEAgyR8BAaLnajUnJEQ/Eoa8EB+ZFxy6o2tvb5CURLKf4M="}],"size":6444,"noattachment":false,"key":"/child-process-promise/-/child-process-promise-2.2.0.tgz"},"maintainers":[{"name":"psteeleidem","email":"psteeleidem@ebay.com"},{"name":"pnidem","email":"pnidem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/child-process-promise-2.2.0.tgz_1477950551878_0.779007552890107"},"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":1477950552434,"_cnpm_publish_time":1477950552434,"dist-tags":{"latest":"2.2.1","v0_2_0-SNAPSHOT":"0.2.0-SNAPSHOT.1389671754086"}}