{"_id":"child-process-async","_rev":"2-8032e0118fadb3bc99fb540760a31ecc","name":"child-process-async","description":"The best way to override Node's child_process module w/ Promises","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"child-process-async","version":"1.0.0","description":"The best way to override Node's child_process module w/ Promises","main":"child-process-async.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/itsjustcon/node-child-process-async.git"},"keywords":["child","process","promise","async"],"author":{"name":"Connor Grady","email":"conair360@gmail.com","url":"http://connorgrady.com/"},"license":"MIT","bugs":{"url":"https://github.com/itsjustcon/node-child-process-async/issues"},"homepage":"https://github.com/itsjustcon/node-child-process-async#readme","devDependencies":{"chai":"^4.1.0","mocha":"^3.4.2"},"gitHead":"a160f227c0508a3dbcb8d670f0d91dfe2d09ec8f","_id":"child-process-async@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.0","_npmUser":{"name":"itsjustcon","email":"conair360@gmail.com"},"dist":{"integrity":"sha512-AVi1hRDNj0LgcY3NfAP4WZTTC9kXAlWZzi++2fP09967KZueYctFKe18RbltPmc86jKGDWRK3YFzZz8xmtYQwQ==","shasum":"55a2ae4a72a1b76657f606491a7c4a78ef705982","tarball":"https://registry.npmjs.org/child-process-async/-/child-process-async-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIERX1NApWEk/3t3PP+px6J6oiQUK6lLVrHZGQPPfUxcVAiEAic7G4GIdhFByAburJAuQPzormtbjfz32o014qoieUMc="}]},"maintainers":[{"name":"itsjustcon","email":"conair360@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/child-process-async-1.0.0.tgz_1500522095796_0.17125194938853383"}},"1.0.1":{"name":"child-process-async","version":"1.0.1","description":"The best way to override Node's child_process module w/ Promises","main":"child-process-async.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/itsjustcon/node-child-process-async.git"},"keywords":["child","process","promise","async"],"author":{"name":"Connor Grady","email":"conair360@gmail.com","url":"http://connorgrady.com/"},"license":"MIT","bugs":{"url":"https://github.com/itsjustcon/node-child-process-async/issues"},"homepage":"https://github.com/itsjustcon/node-child-process-async#readme","devDependencies":{"chai":"^4.1.0","mocha":"^3.4.2"},"gitHead":"92e45897468d885a026a000a2f0cd3aac410810f","_id":"child-process-async@1.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.2.0","_npmUser":{"name":"itsjustcon","email":"conair360@gmail.com"},"dist":{"integrity":"sha512-5azrGe+ED5oBFgspraK+A5Uqg1RQ7vsh7auoxvOWsRF3KxbiPLd9zX/DAq2zD5WV+Z4xyMbWSOHkXWy51EsK9g==","shasum":"ee3f0da64421ce6bcd79119003893c53810c4723","tarball":"https://registry.npmjs.org/child-process-async/-/child-process-async-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICupxYGk93Ts5ZbDv5qW/6Mft4npxMbmUATuuAhA6p6DAiEAtcuFbfnIDBK+kj5WXob7M+lxO5null2P5JRgxczzQkg="}]},"maintainers":[{"name":"itsjustcon","email":"conair360@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/child-process-async-1.0.1.tgz_1500606567956_0.4012771819252521"}}},"readme":"# child-process-async\nThe best way to override Node's [`child_process`](https://nodejs.org/api/child_process.html) module w/ Promises\n\n`child-process-async` provides a **drop-in replacement** for the original\n`child_process` functions, not just duplicate methods that return a Promise.\nSo when you call `exec(...)` we still return a `ChildProcess` instance, just\nwith `.then()` and `.catch()` added to it to make it promise-friendly.\n\n## Install\n```shell\nnpm install --save child-process-async\n```\n\n## Usage\n\n```js\n// OLD:\nconst { exec, spawn } = require('child_process');\n// NEW:\nconst { exec, spawn } = require('child-process-async');\n```\n\n### `exec()`\n```js\nasync function() {\n  const { stdout, stderr } = await exec('ls -al');\n  // OR:\n  const child = await exec('ls -al', {});\n  // do whatever you want with `child` here - it's a ChildProcess instance just\n  // with promise-friendly `.then()` & `.catch()` functions added to it!\n  child.stdin.write(...);\n  child.stdout.pipe(...);\n  child.stderr.on('data', (data) => ...);\n  const { stdout, stderr } = await child;\n}\n```\n\n### `spawn()`\n```js\nasync function() {\n  const { stdout, stderr, exitCode } = await spawn('ls', [ '-al' ]);\n  // OR:\n  const child = spawn('ls', [ '-al' ], {});\n  // do whatever you want with `child` here - it's a ChildProcess instance just\n  // with promise-friendly `.then()` & `.catch()` functions added to it!\n  child.stdin.write(...);\n  child.stdout.pipe(...);\n  child.stderr.on('data', (data) => ...);\n  const { stdout, stderr, exitCode } = await child;\n}\n```\n","maintainers":[{"name":"itsjustcon","email":"conair360@gmail.com"}],"time":{"modified":"2022-04-12T06:09:09.643Z","created":"2017-07-20T03:41:36.765Z","1.0.0":"2017-07-20T03:41:36.765Z","1.0.1":"2017-07-21T03:09:28.892Z"},"homepage":"https://github.com/itsjustcon/node-child-process-async#readme","keywords":["child","process","promise","async"],"repository":{"type":"git","url":"git+https://github.com/itsjustcon/node-child-process-async.git"},"author":{"name":"Connor Grady","email":"conair360@gmail.com","url":"http://connorgrady.com/"},"bugs":{"url":"https://github.com/itsjustcon/node-child-process-async/issues"},"license":"MIT","readmeFilename":"README.md"}