{"name":"execa","version":"0.5.0","description":"A better `child_process`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/execa.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"maintainers":[{"name":"ehmicky","email":"ehmicky@gmail.com"}],"engines":{"node":">=4"},"scripts":{"test":"xo && nyc ava"},"files":["index.js","lib"],"keywords":["exec","child","process","execute","fork","execfile","spawn","file","shell","bin","binary","binaries","npm","path","local"],"dependencies":{"cross-spawn":"^4.0.0","get-stream":"^2.2.0","is-stream":"^1.1.0","npm-run-path":"^2.0.0","signal-exit":"^3.0.0","strip-eof":"^1.0.0"},"devDependencies":{"ava":"*","cat-names":"^1.0.2","coveralls":"^2.11.9","delay":"^1.3.1","is-running":"^2.0.0","nyc":"^8.3.0","xo":"*"},"nyc":{"reporter":["text","lcov"],"exclude":["node_modules","**/fixtures/**","**/test.js","**/test/**"]},"xo":{"esnext":true},"gitHead":"842be7c11a33c71177ea03ff12412047f3d8bd07","bugs":{"url":"https://github.com/sindresorhus/execa/issues"},"homepage":"https://github.com/sindresorhus/execa#readme","_id":"execa@0.5.0","_shasum":"a57456764b990e3e52f6eff7f17a9cc2ff2e7ccc","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a57456764b990e3e52f6eff7f17a9cc2ff2e7ccc","size":5076,"noattachment":false,"tarball":"https://registry.npmmirror.com/execa/-/execa-0.5.0.tgz","integrity":"sha512-wtvDYrVKSSUfxb6jwgFNX8RhtE34ErP9s9ychsBAJQB5+vlpcKHMg0ea5ewQYEwXKDnQ2MkJyHLh5BqORap1XA=="},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/execa-0.5.0.tgz_1475656096594_0.8247949031647295"},"directories":{},"publish_time":1475656099328,"_hasShrinkwrap":false,"_cnpm_publish_time":1475656099328,"_cnpmcore_publish_time":"2021-12-13T10:54:44.936Z","readme":"# execa [![Build Status: Linux](https://travis-ci.org/sindresorhus/execa.svg?branch=master)](https://travis-ci.org/sindresorhus/execa) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/x5ajamxtjtt93cqv/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/execa/branch/master) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/execa/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/execa?branch=master)\n\n> A better [`child_process`](https://nodejs.org/api/child_process.html)\n\n\n## Why\n\n- Promise interface.\n- [Strips EOF](https://github.com/sindresorhus/strip-eof) from the output so you don't have to `stdout.trim()`.\n- Supports [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) binaries cross-platform.\n- [Improved Windows support.](https://github.com/IndigoUnited/node-cross-spawn#why)\n- Higher max buffer. 10 MB instead of 200 KB.\n- [Executes locally installed binaries by name.](#preferlocal)\n- [Cleans up spawned processes when the parent process dies.](#cleanup)\n\n\n## Install\n\n```\n$ npm install --save execa\n```\n\n\n## Usage\n\n```js\nconst execa = require('execa');\n\nexeca('echo', ['unicorns']).then(result => {\n\tconsole.log(result.stdout);\n\t//=> 'unicorns'\n});\n\n// pipe the child process stdout to the current stdout\nexeca('echo', ['unicorns']).stdout.pipe(process.stdout);\n\nexeca.shell('echo unicorns').then(result => {\n\tconsole.log(result.stdout);\n\t//=> 'unicorns'\n});\n\n// example of catching an error\nexeca.shell('exit 3').catch(error => {\n\tconsole.log(error);\n\t/*\n\t{\n\t\tmessage: 'Command failed: /bin/sh -c exit 3'\n\t\tkilled: false,\n\t\tcode: 3,\n\t\tsignal: null,\n\t\tcmd: '/bin/sh -c exit 3',\n\t\tstdout: '',\n\t\tstderr: ''\n\t}\n\t*/\n});\n```\n\n\n## API\n\n### execa(file, [arguments], [options])\n\nExecute a file.\n\nSame options as [`child_process.execFile`](https://nodejs.org/api/child_process.html#child_process_child_process_execfile_file_args_options_callback).\n\nThink of this as a mix of `child_process.execFile` and `child_process.spawn`.\n\nReturns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.\n\n### execa.stdout(file, [arguments], [options])\n\nSame as `execa()`, but returns only `stdout`.\n\n### execa.stderr(file, [arguments], [options])\n\nSame as `execa()`, but returns only `stderr`.\n\n### execa.shell(command, [options])\n\nExecute a command through the system shell. Prefer `execa()` whenever possible, as it's both faster and safer.\n\nSame options as [`child_process.exec`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback).\n\nReturns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess).\n\nThe `child_process` instance is enhanced to also be promise for a result object with `stdout` and `stderr` properties.\n\n### execa.sync(file, [arguments], [options])\n\nExecute a file synchronously.\n\nSame options as [`child_process.execFileSync`](https://nodejs.org/api/child_process.html#child_process_child_process_execfilesync_file_args_options), except the default encoding is `utf8` instead of `buffer`.\n\nReturns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options).\n\n### execa.shellSync(file, [options])\n\nExecute a command synchronously through the system shell.\n\nSame options as [`child_process.execSync`](https://nodejs.org/api/child_process.html#child_process_child_process_execsync_command_options), except the default encoding is `utf8` instead of `buffer`.\n\nReturns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options).\n\n### options\n\nAdditional options:\n\n#### stripEof\n\nType: `boolean`
\nDefault: `true`\n\n[Strip EOF](https://github.com/sindresorhus/strip-eof) (last newline) from the output.\n\n#### preferLocal\n\nType: `boolean`
\nDefault: `true`\n\nPrefer locally installed binaries when looking for a binary to execute.
\nIf you `$ npm install foo`, you can then `execa('foo')`.\n\n#### input\n\nType: `string` `Buffer` `ReadableStream`\n\nWrite some input to the `stdin` of your binary.
\nStreams are not allowed when using the synchronous methods.\n\n#### reject\n\nType: `boolean`
\nDefault: `true`\n\nSetting this to `false` resolves the promise with the error instead of rejecting it.\n\n#### cleanup\n\nType: `boolean`
\nDefault: `true`\n\nKeep track of the spawned process and `kill` it when the parent process exits.\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n"}