{"_id":"@jsdevtools/ez-spawn","_rev":"1721062","name":"@jsdevtools/ez-spawn","description":"Simple, consistent sync or async process spawning","dist-tags":{"latest":"3.0.4"},"maintainers":[{"name":"jamesmessinger","email":"james.messinger@gmail.com"},{"name":"mcous","email":""},{"name":"philsturgeon","email":"me@philsturgeon.uk"}],"time":{"modified":"2021-11-29T01:30:44.000Z","created":"2020-02-19T13:16:03.475Z","3.0.4":"2020-07-16T13:48:23.251Z","3.0.3":"2020-03-16T11:12:56.104Z","3.0.2":"2020-03-16T10:50:26.367Z","3.0.1":"2020-03-10T10:40:35.893Z","3.0.0":"2020-02-19T13:27:47.838Z","2.1.6":"2020-02-19T13:16:03.475Z"},"users":{},"author":{"name":"James Messinger","url":"https://jamesmessinger.com"},"repository":{"type":"git","url":"git+https://github.com/JS-DevTools/ez-spawn.git"},"versions":{"3.0.4":{"name":"@jsdevtools/ez-spawn","version":"3.0.4","description":"Simple, consistent sync or async process spawning","keywords":["cli","process","spawn","exec","sync","async"],"author":{"name":"James Messinger","url":"https://jamesmessinger.com"},"contributors":[{"name":"Randall Krauskopf","url":"http://github.com/rkrauskopf"},{"name":"James Messinger","url":"https://jamesmessinger.com"}],"license":"MIT","homepage":"https://jstools.dev/ez-spawn","repository":{"type":"git","url":"git+https://github.com/JS-DevTools/ez-spawn.git"},"main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"clean":"shx rm -rf .nyc_output coverage","lint":"eslint lib test","test":"npm run test:node && npm run test:typescript && npm run lint","test:node":"mocha","test:typescript":"tsc --noEmit test/specs/typescript-definition.spec.ts","coverage":"nyc node_modules/mocha/bin/mocha","upgrade":"npm-check -u && npm audit fix","bump":"bump --tag --push --all","release":"npm run upgrade && npm run clean && npm test && npm run bump"},"devDependencies":{"@jsdevtools/eslint-config":"^1.0.3","@jsdevtools/version-bump-prompt":"^6.0.5","@types/node":"^14.0.23","chai":"^4.2.0","eslint":"^7.4.0","mocha":"^8.0.1","npm-check":"^5.9.2","nyc":"^15.1.0","shx":"^0.3.2","typescript":"^3.9.6"},"dependencies":{"call-me-maybe":"^1.0.1","cross-spawn":"^7.0.3","string-argv":"^0.3.1","type-detect":"^4.0.8"},"engines":{"node":">=10"},"gitHead":"e7b51d8693be9b5ccedbe7eac7f8f7dd81b59ea2","bugs":{"url":"https://github.com/JS-DevTools/ez-spawn/issues"},"_id":"@jsdevtools/ez-spawn@3.0.4","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"shasum":"5641eb26fee6d31ec29f6788eba849470c52c7ff","size":9796,"noattachment":false,"key":"/@jsdevtools/ez-spawn/-/@jsdevtools/ez-spawn-3.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/@jsdevtools/ez-spawn/download/@jsdevtools/ez-spawn-3.0.4.tgz"},"maintainers":[{"name":"jamesmessinger","email":"james.messinger@gmail.com"},{"name":"mcous","email":""},{"name":"philsturgeon","email":"me@philsturgeon.uk"}],"_npmUser":{"name":"jamesmessinger","email":"james.messinger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ez-spawn_3.0.4_1594907303122_0.502220989293146"},"_hasShrinkwrap":false,"publish_time":1594907303251,"_cnpm_publish_time":1594907303251},"3.0.3":{"name":"@jsdevtools/ez-spawn","version":"3.0.3","description":"Simple, consistent sync or async process spawning","keywords":["cli","process","spawn","exec","sync","async"],"author":{"name":"James Messinger","url":"https://jamesmessinger.com"},"contributors":[{"name":"Randall Krauskopf","url":"http://github.com/rkrauskopf"},{"name":"James Messinger","url":"https://jamesmessinger.com"}],"license":"MIT","homepage":"https://jstools.dev/ez-spawn","repository":{"type":"git","url":"git+https://github.com/JS-DevTools/ez-spawn.git"},"main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"clean":"shx rm -rf .nyc_output coverage","lint":"eslint lib test","test":"npm run test:node && npm run test:typescript && npm run lint","test:node":"mocha","test:typescript":"tsc --noEmit test/specs/typescript-definition.spec.ts","coverage":"nyc node_modules/mocha/bin/mocha","upgrade":"npm-check -u && npm audit fix","bump":"bump --tag --push --all","release":"npm run upgrade && npm run clean && npm test && npm run bump"},"devDependencies":{"@jsdevtools/eslint-config-modular":"^8.0.0","@jsdevtools/version-bump-prompt":"^6.0.2","@types/node":"^13.9.0","chai":"^4.2.0","eslint":"^6.6.0","mocha":"^7.1.0","npm-check":"^5.9.2","nyc":"^15.0.0","shx":"^0.3.2","typescript":"^3.8.3"},"dependencies":{"call-me-maybe":"^1.0.1","cross-spawn":"^7.0.1","string-argv":"^0.3.1","type-detect":"^4.0.8"},"engines":{"node":">=10"},"gitHead":"60a3b6ad05843383e89632f903f5c677fcc95f11","bugs":{"url":"https://github.com/JS-DevTools/ez-spawn/issues"},"_id":"@jsdevtools/ez-spawn@3.0.3","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"shasum":"1734e3869ab8dbc68be8eaee7daa67381bdd5fd3","size":9807,"noattachment":false,"key":"/@jsdevtools/ez-spawn/-/@jsdevtools/ez-spawn-3.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@jsdevtools/ez-spawn/download/@jsdevtools/ez-spawn-3.0.3.tgz"},"maintainers":[{"name":"jamesmessinger","email":"james.messinger@gmail.com"},{"name":"mcous","email":""},{"name":"philsturgeon","email":"me@philsturgeon.uk"}],"_npmUser":{"name":"jamesmessinger","email":"james.messinger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ez-spawn_3.0.3_1584357175960_0.8315234887689622"},"_hasShrinkwrap":false,"publish_time":1584357176104,"_cnpm_publish_time":1584357176104},"3.0.2":{"name":"@jsdevtools/ez-spawn","version":"3.0.2","description":"Simple, consistent sync or async process spawning","keywords":["cli","process","spawn","exec","sync","async"],"author":{"name":"James Messinger","url":"https://jamesmessinger.com"},"contributors":[{"name":"Randall Krauskopf","url":"http://github.com/rkrauskopf"},{"name":"James Messinger","url":"https://jamesmessinger.com"}],"license":"MIT","homepage":"https://jstools.dev/ez-spawn","repository":{"type":"git","url":"git+https://github.com/JS-DevTools/ez-spawn.git"},"main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"clean":"shx rm -rf .nyc_output coverage","lint":"eslint lib test","test":"npm run test:node && npm run test:typescript && npm run lint","test:node":"mocha","test:typescript":"tsc --noEmit test/specs/typescript-definition.spec.ts","coverage":"nyc node_modules/mocha/bin/mocha","upgrade":"npm-check -u && npm audit fix","bump":"bump --tag --push --all","release":"npm run upgrade && npm run clean && npm test && npm run bump"},"devDependencies":{"@jsdevtools/eslint-config-modular":"^8.0.0","@jsdevtools/version-bump-prompt":"^6.0.2","@types/node":"^13.9.0","chai":"^4.2.0","eslint":"^6.6.0","mocha":"^7.1.0","npm-check":"^5.9.2","nyc":"^15.0.0","shx":"^0.3.2","typescript":"^3.8.3"},"dependencies":{"call-me-maybe":"^1.0.1","cross-spawn":"^7.0.1","string-argv":"^0.3.1","type-detect":"^4.0.8"},"engines":{"node":">=10"},"gitHead":"4e54ecde4e4c1f49fb7db0dc5ff02502e3c4a235","bugs":{"url":"https://github.com/JS-DevTools/ez-spawn/issues"},"_id":"@jsdevtools/ez-spawn@3.0.2","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"shasum":"dad1b4f92343a00f7e357bc90e87e1994e70fca5","size":9660,"noattachment":false,"key":"/@jsdevtools/ez-spawn/-/@jsdevtools/ez-spawn-3.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@jsdevtools/ez-spawn/download/@jsdevtools/ez-spawn-3.0.2.tgz"},"maintainers":[{"name":"jamesmessinger","email":"james.messinger@gmail.com"},{"name":"mcous","email":""},{"name":"philsturgeon","email":"me@philsturgeon.uk"}],"_npmUser":{"name":"jamesmessinger","email":"james.messinger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ez-spawn_3.0.2_1584355826271_0.7172579216593973"},"_hasShrinkwrap":false,"publish_time":1584355826367,"_cnpm_publish_time":1584355826367},"3.0.1":{"name":"@jsdevtools/ez-spawn","version":"3.0.1","description":"Simple, consistent sync or async process spawning","keywords":["cli","process","spawn","exec","sync","async"],"author":{"name":"James Messinger","url":"https://jamesmessinger.com"},"contributors":[{"name":"Randall Krauskopf","url":"http://github.com/rkrauskopf"},{"name":"James Messinger","url":"https://jamesmessinger.com"}],"license":"MIT","homepage":"https://jstools.dev/ez-spawn","repository":{"type":"git","url":"git+https://github.com/JS-DevTools/ez-spawn.git"},"main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"clean":"shx rm -rf .nyc_output coverage","lint":"eslint lib test","test":"npm run test:node && npm run test:typescript && npm run lint","test:node":"mocha","test:typescript":"tsc --noEmit test/specs/typescript-definition.spec.ts","coverage":"nyc node_modules/mocha/bin/mocha","upgrade":"npm-check -u && npm audit fix","bump":"bump --tag --push --all","release":"npm run upgrade && npm run clean && npm test && npm run bump"},"devDependencies":{"@jsdevtools/eslint-config-modular":"^8.0.0","@jsdevtools/version-bump-prompt":"^6.0.2","@types/node":"^13.9.0","chai":"^4.2.0","eslint":"^6.6.0","mocha":"^7.1.0","npm-check":"^5.9.2","nyc":"^15.0.0","shx":"^0.3.2","typescript":"^3.8.3"},"dependencies":{"call-me-maybe":"^1.0.1","cross-spawn":"^7.0.1","string-argv":"^0.3.1","type-detect":"^4.0.8"},"engines":{"node":">=10"},"gitHead":"80ab82ef791f2e244da0672857f12a0791e8af14","bugs":{"url":"https://github.com/JS-DevTools/ez-spawn/issues"},"_id":"@jsdevtools/ez-spawn@3.0.1","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"shasum":"7874ec730675a7e422996e01a860f91897d9c44b","size":9618,"noattachment":false,"key":"/@jsdevtools/ez-spawn/-/@jsdevtools/ez-spawn-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@jsdevtools/ez-spawn/download/@jsdevtools/ez-spawn-3.0.1.tgz"},"maintainers":[{"name":"jamesmessinger","email":"james.messinger@gmail.com"},{"name":"mcous","email":""},{"name":"philsturgeon","email":"me@philsturgeon.uk"}],"_npmUser":{"name":"jamesmessinger","email":"james.messinger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ez-spawn_3.0.1_1583836835751_0.4788095120316276"},"_hasShrinkwrap":false,"publish_time":1583836835893,"_cnpm_publish_time":1583836835893},"3.0.0":{"name":"@jsdevtools/ez-spawn","version":"3.0.0","description":"Simple, consistent sync or async process spawning","keywords":["cli","process","spawn","exec","sync","async"],"author":{"name":"Randall Krauskopf","url":"http://github.com/rkrauskopf"},"contributors":[{"name":"Randall Krauskopf","url":"http://github.com/rkrauskopf"},{"name":"James Messinger","url":"https://jamesmessinger.com"}],"license":"MIT","homepage":"https://jstools.dev/ez-spawn","repository":{"type":"git","url":"git+https://github.com/JS-DevTools/ez-spawn.git"},"main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"clean":"shx rm -rf .nyc_output coverage","lint":"eslint lib test","test":"npm run test:node && npm run test:typescript && npm run lint","test:node":"mocha","test:typescript":"tsc --noEmit test/specs/typescript-definition.spec.ts","coverage":"nyc node_modules/mocha/bin/mocha","upgrade":"npm-check -u && npm audit fix","bump":"bump --tag --push --all","release":"npm run upgrade && npm run clean && npm test && npm run bump"},"devDependencies":{"@jsdevtools/eslint-config-modular":"^8.0.0","@jsdevtools/version-bump-prompt":"^6.0.1","@types/node":"^13.7.2","chai":"^4.2.0","eslint":"^6.6.0","mocha":"^7.0.1","npm-check":"^5.9.0","nyc":"^15.0.0","shx":"^0.3.2","typescript":"^3.7.2"},"dependencies":{"call-me-maybe":"^1.0.1","cross-spawn":"^7.0.1","string-argv":"^0.3.1","type-detect":"^4.0.8"},"engines":{"node":">=10"},"gitHead":"e4ebbc228c999ee71eb4e7c4f6363aba54cdd73f","bugs":{"url":"https://github.com/JS-DevTools/ez-spawn/issues"},"_id":"@jsdevtools/ez-spawn@3.0.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"shasum":"621f37395034500c91c95ac538f24c89c4230740","size":9608,"noattachment":false,"key":"/@jsdevtools/ez-spawn/-/@jsdevtools/ez-spawn-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@jsdevtools/ez-spawn/download/@jsdevtools/ez-spawn-3.0.0.tgz"},"maintainers":[{"name":"jamesmessinger","email":"james.messinger@gmail.com"},{"name":"mcous","email":""},{"name":"philsturgeon","email":"me@philsturgeon.uk"}],"_npmUser":{"name":"jamesmessinger","email":"james.messinger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ez-spawn_3.0.0_1582118867742_0.33210222052705607"},"_hasShrinkwrap":false,"publish_time":1582118867838,"_cnpm_publish_time":1582118867838},"2.1.6":{"name":"@jsdevtools/ez-spawn","version":"2.1.6","description":"Simple, consistent sync or async process spawning","keywords":["cli","process","spawn","exec","sync","async"],"author":{"name":"Randall Krauskopf","url":"http://github.com/rkrauskopf"},"contributors":[{"name":"Randall Krauskopf","url":"http://github.com/rkrauskopf"},{"name":"James Messinger","url":"https://jamesmessinger.com"}],"license":"MIT","homepage":"https://jstools.dev/ez-spawn","repository":{"type":"git","url":"git+https://github.com/JS-DevTools/ez-spawn.git"},"main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"clean":"shx rm -rf .nyc_output coverage","lint":"eslint lib test","test":"npm run test:node && npm run test:typescript && npm run lint","test:node":"mocha","test:typescript":"tsc --noEmit test/specs/typescript-definition.spec.ts","coverage":"nyc node_modules/mocha/bin/mocha","upgrade":"npm-check -u && npm audit fix","bump":"bump --tag --push --all","release":"npm run upgrade && npm run clean && npm run build && npm test && npm run bump"},"devDependencies":{"@jsdevtools/eslint-config-modular":"^8.0.0","@jsdevtools/version-bump-prompt":"^6.0.1","@types/node":"^13.7.2","chai":"^4.2.0","eslint":"^6.6.0","mocha":"^7.0.1","npm-check":"^5.9.0","nyc":"^15.0.0","shx":"^0.3.2","typescript":"^3.7.2"},"dependencies":{"call-me-maybe":"^1.0.1","cross-spawn":"^7.0.1","string-argv":"^0.3.1","type-detect":"^4.0.8"},"engines":{"node":">=10"},"gitHead":"7e4915a1d2ec2ba4a501a5e24d2b8a28edd9e12a","bugs":{"url":"https://github.com/JS-DevTools/ez-spawn/issues"},"_id":"@jsdevtools/ez-spawn@2.1.6","_nodeVersion":"13.3.0","_npmVersion":"6.13.1","dist":{"shasum":"90d3e28a68f5a30761f5c8cd41247fe7905166a9","size":9618,"noattachment":false,"key":"/@jsdevtools/ez-spawn/-/@jsdevtools/ez-spawn-2.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/@jsdevtools/ez-spawn/download/@jsdevtools/ez-spawn-2.1.6.tgz"},"maintainers":[{"name":"jamesmessinger","email":"james.messinger@gmail.com"},{"name":"mcous","email":""},{"name":"philsturgeon","email":"me@philsturgeon.uk"}],"_npmUser":{"name":"jamesmessinger","email":"james.messinger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ez-spawn_2.1.6_1582118163363_0.7041367958319877"},"_hasShrinkwrap":false,"publish_time":1582118163475,"_cnpm_publish_time":1582118163475}},"readme":"EZ Spawn\n=======================\n\n#### Simple, consistent process spawning\n\n[![Cross-Platform Compatibility](https://jstools.dev/img/badges/os-badges.svg)](https://github.com/JS-DevTools/ez-spawn/actions)\n[![Build Status](https://github.com/JS-DevTools/ez-spawn/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/ez-spawn/actions)\n\n[![Coverage Status](https://coveralls.io/repos/github/JS-DevTools/ez-spawn/badge.svg?branch=master)](https://coveralls.io/github/JS-DevTools/ez-spawn?branch=master)\n[![Dependencies](https://david-dm.org/JS-DevTools/ez-spawn.svg)](https://david-dm.org/JS-DevTools/ez-spawn)\n\n[![npm](https://img.shields.io/npm/v/@jsdevtools/ez-spawn.svg)](https://www.npmjs.com/package/@jsdevtools/ez-spawn)\n[![License](https://img.shields.io/npm/l/@jsdevtools/ez-spawn.svg)](LICENSE)\n[![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/JS-DevTools/ez-spawn)\n\n\n\nFeatures\n--------------------------\n- **Flexible input parameters**<br>\n  Pass the program and arguments as a single string, an array of strings, or as separate parameters.\n\n- **Pick your async syntax**<br>\n  Supports Promises, `async`/`await`, or callbacks.\n\n- **Simple, consistent error handling**<br>\n  Non-zero exit codes are treated just like any other error. See [Error Handling](#error-handling) for more details.\n\n- **String output by default**<br>\n  stdout and stderr output is automatically decoded as UTF-8 text by default.  You can set the [`encoding` option](#options-object) for a different encoding, or even raw binary buffers.\n\n- **Windows Support**<br>\n  Excellent Windows support, thanks to [cross-spawn](https://github.com/moxystudio/node-cross-spawn).\n\n\n\nRelated Projects\n--------------------------\n- [chai-exec](https://github.com/JS-DevTools/chai-exec) - Chai assertion plugin for testing CLIs\n\n\n\nExamples\n--------------------------\n\n```javascript\nconst ezSpawn = require('@jsdevtools/ez-spawn');\n\n// These are all identical\nezSpawn.sync(`git commit -am \"Fixed a bug\"`);           // Pass program and args as a string\nezSpawn.sync(\"git\", \"commit\", \"-am\", \"Fixed a bug\");    // Pass program and args as separate params\nezSpawn.sync([\"git\", \"commit\", \"-am\", \"Fixed a bug\"]);  // Pass program and args as an array\nezSpawn.sync(\"git\", [\"commit\", \"-am\", \"Fixed a bug\"]);  // Pass program as a string and args as an array\n\n// Make a synchronous call\nlet process = ezSpawn.sync(`git commit -am \"Fixed a bug\"`);\nconsole.log(process.stdout);\n\n//Make an asynchronous call, using async/await syntax\nlet process = await ezSpawn.async(`git commit -am \"Fixed a bug\"`);\nconsole.log(process.stdout);\n\n//Make an asynchronous call, using callback syntax\nezSpawn.async(`git commit -am \"Fixed a bug\"`, (err, process) => {\n  console.log(process.stdout);\n});\n\n//Make an asynchronous call, using Promise syntax\nezSpawn.async(`git commit -am \"Fixed a bug\"`)\n  .then((process) => {\n    console.log(process.stdout);\n  });\n```\n\n\n\nInstallation\n--------------------------\nInstall using [npm](https://docs.npmjs.com/about-npm/):\n\n```bash\nnpm install @jsdevtools/ez-spawn\n```\n\nThen require it in your code:\n\n```javascript\n// Require the whole package\nconst ezSpawn = require(\"@jsdevtools/ez-spawn\");\n\n// Or require \"sync\" or \"async\" directly\nconst ezSpawnSync = require(\"@jsdevtools/ez-spawn\").sync;\nconst ezSpawnAsync = require(\"@jsdevtools/ez-spawn\").async;\n```\n\n\n\nAPI\n--------------------------\n### `ezSpawn.sync(command, [...arguments], [options])`\nSynchronously spawns a process.  This function returns when the proecess exits.\n\n- The `command` and `arguments` parameters can be passed as a single space-separated string, or as an array of strings, or as separate parameters.\n\n- The [`options` object](#options-object) is optional.\n\n- Returns a [`Process` object](#process-object)\n\n\n### `ezSpawn.async(command, [...arguments], [options], [callback])`\nAsynchronously spawns a process.  The Promise resolves (or the callback is called) when the process exits.\n\n- The `command` and `arguments` parameters can be passed as a single space-separated string, or as an array of strings, or as separate parameters.\n\n- The [`options` object](#options-object) is optional.\n\n- If a `callback` is provided, then it will be called when the process exits.  The first is either an `Error` or `null`.  The second parameter is a [`Process` object](#process-object).\n\n- If **no** `callback` is provided, then a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) is returned.  It will resolve with a [`Process` object](#process-object) when the process exits.\n\n\n### `Options` object\n`ezSpawn.async()` and `ezSpawn.sync()` both accept an optional `options` object that closely mirrors the `options` parameter of Node's [`spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options), [`exec`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback), [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options), and [`execSync`](https://nodejs.org/api/child_process.html#child_process_child_process_execsync_command_options) functions.\n\n- `cwd` (string)<br>\n  The current working directory of the child process.\n\n- `env` (Object)<br>\n  Environment variable key-value pairs.\n\n- `argv0` (string)<br>\n  Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` if not specified.\n\n- `stdio` (Array or string)<br>\n  The child process's stdio configuration (see [options.stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio)).\n\n- `input` (string, Buffer, TypedArray, or DataView)<br>\n  The value which will be passed as stdin to the spawned process. Supplying this value will override `stdio[0]`.\n\n- `uid` (number)<br>\n  Sets the user identity of the process.\n\n- `gid` (number)<br>\n  Sets the group identity of the process.\n\n- `timeout` (number)<br>\n  The maximum amount of time (in milliseconds) the process is allowed to run.\n\n- `killSignal` (string or integer)<br>\n  The signal value to be used when the spawned process will be killed. Defaults to `\"SIGTERM\"`.\n\n- `maxBuffer` (number)<br>\n  The largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated.\n\n- `encoding` (string)<br>\n  The encoding used for all stdio inputs and outputs. Defaults to `\"utf8\"`. Set to `\"buffer\"` for raw binary output.\n\n- `shell` (boolean or string)<br>\n  If `true`, then `command` will be run inside of a shell. Uses \"/bin/sh\" on UNIX, and `process.env.ComSpec` on Windows. A different shell can be specified as a string.\n\n- `windowsVerbatimArguments` (boolean)<br>\n  No quoting or escaping of arguments is done on Windows. Ignored on Unix. This is set to true automatically when `shell` is `\"CMD\"`.\n\n- `windowsHide` (boolean)<br>\n  Hide the subprocess console window that would normally be created on Windows systems.\n\n\n### `Process` object\n`ezSpawn.async()` and `ezSpawn.sync()` both return a `Process` object that closely mirrors the object returned by Node's [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options) function.\n\n- `command` (string)<br>\n  The command that was used to spawn the process.\n\n- `args` (array of strings)<br>\n  The command-line arguments that were passed to the process.\n\n- `pid` (number)<br>\n  The numeric process ID assigned by the operating system.\n\n- `stdout` (string or Buffer)<br>\n  The process's standard output. This is the same value as `output[1]`.\n\n- `stderr` (string or Buffer)<br>\n  The process's error output. This is the same value as `output[2]`.\n\n- `output` (array of strings or Buffers)<br>\n  The process's stdio [stdin, stdout, stderr].\n\n- `status` (number)<br>\n  The process's status code (a.k.a. \"exit code\").\n\n- `signal` (string or null)<br>\n  The signal used to kill the process, if the process was killed by a signal.\n\n- `toString()`<br>\n  Returns the `command` and `args` as a single string.  Useful for console logging.\n\n\n\nError Handling\n--------------------------\nAll sorts of errors can occur when spawning processes.  Node's built-in [`spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) and [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options) functions handle different types of errors in different ways.  Sometimes they throw the error, somtimes they emit an [\"error\" event](https://nodejs.org/docs/latest/api/child_process.html#child_process_event_error), and sometimes they return an object with an `error` property.  They also don't treat non-zero exit codes as errors.  So it's up to you to handle all these different types of errors, and check the exit code too.\n\nEZ Spawn simplifies things by treating all errors the same.  If any error occurs, or if the process exits with a non-zero exit code, then an error is thrown.  The error will have all the same properties as the [`Process` object](#process-object), such as `status`, `stderr`, `signal`, etc.\n\n```javascript\ntry {\n  let process = ezSpawn.sync(`git commit -am \"Fixed a bug\"`, { throwOnError: true });\n  console.log(\"Everything worked great!\", process.stdout);\n}\ncatch (error) {\n  console.error(\"Something went wrong!\", error.status, error.stderr);\n}\n```\n\n\n\nContributing\n--------------------------\nContributions, enhancements, and bug-fixes are welcome! [Open an issue](https://github.com/JS-DevTools/ez-spawn/issues) on GitHub and [submit a pull request](https://github.com/JS-DevTools/ez-spawn/pulls).\n\n#### Building/Testing\nTo build/test the project locally on your computer:\n\n1. __Clone this repo__<br>\n`git clone hhttps://github.com/JS-DevTools/ez-spawn.git`\n\n2. __Install dependencies__<br>\n`npm install`\n\n3. __Run the tests__<br>\n`npm test`\n\n\n\nLicense\n--------------------------\nEZ Spawn is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.\n\nThis package is [Treeware](http://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/JS-DevTools/ez-spawn) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.\n\n\n\nBig Thanks To\n--------------------------\nThanks to these awesome companies for their support of Open Source developers ❤\n\n[![Travis CI](https://jstools.dev/img/badges/travis-ci.svg)](https://travis-ci.com)\n[![SauceLabs](https://jstools.dev/img/badges/sauce-labs.svg)](https://saucelabs.com)\n[![Coveralls](https://jstools.dev/img/badges/coveralls.svg)](https://coveralls.io)\n","_attachments":{},"homepage":"https://jstools.dev/ez-spawn","bugs":{"url":"https://github.com/JS-DevTools/ez-spawn/issues"},"license":"MIT"}