api.md
This file
Path
docs/api.md
1,169 lines · 45.7 KiB · Markdown
Last changed by
Add `error.isForcefullyTerminated` (#1111)ehmickybefore adoptione69985d
History of this fileTake it
Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1–17why, one step back1<picture>2 <source media="(prefers-color-scheme: dark)" srcset="../media/logo_dark.svg">3 <img alt="execa logo" src="../media/logo.svg" width="400">4</picture>5<br>67# 📔 API reference89This lists all available [methods](#methods) and their [options](#options). This also describes the properties of the [subprocess](#subprocess), [result](#result) and [error](#execaerror) they return.1011## Methods1213### execa(file, arguments?, options?)1415`file`: `string | URL`\16`arguments`: `string[]`\17`options`: [`Options`](#options)\Rename some types (#1009)ehmickybefore adoption2ef9186
line 18why, one step back18_Returns_: [`ResultPromise`](#return-value)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 19–28why, one step back1920Executes a command using `file ...arguments`.2122More info on the [syntax](execution.md#array-syntax) and [escaping](escaping.md#array-syntax).2324### execa\`command\`25### execa(options)\`command\`2627`command`: `string`\28`options`: [`Options`](#options)\Rename some types (#1009)ehmickybefore adoption2ef9186
line 29why, one step back29_Returns_: [`ResultPromise`](#return-value)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 30–46why, one step back3031Executes a command. `command` is a [template string](execution.md#template-string-syntax) that includes both the `file` and its `arguments`.3233More info on the [syntax](execution.md#template-string-syntax) and [escaping](escaping.md#template-string-syntax).3435### execa(options)3637`options`: [`Options`](#options)\38_Returns_: [`execa`](#execafile-arguments-options)3940Returns a new instance of Execa but with different default [`options`](#options). Consecutive calls are merged to previous ones.4142[More info.](execution.md#globalshared-options)4344### execaSync(file, arguments?, options?)45### execaSync\`command\`46Rename some types (#1009)ehmickybefore adoption2ef9186
line 47why, one step back47_Returns_: [`SyncResult`](#return-value)Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 48why, one step back48Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 49–59why, one step back49Same as [`execa()`](#execafile-arguments-options) but synchronous.5051Returns or throws a subprocess [`result`](#result). The [`subprocess`](#subprocess) is not returned: its methods and properties are not available.5253[More info.](execution.md#synchronous-execution)5455### $(file, arguments?, options?)5657`file`: `string | URL`\58`arguments`: `string[]`\59`options`: [`Options`](#options)\Rename some types (#1009)ehmickybefore adoption2ef9186
line 60why, one step back60_Returns_: [`ResultPromise`](#return-value)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 61–74why, one step back6162Same as [`execa()`](#execafile-arguments-options) but using [script-friendly default options](scripts.md#script-files).6364Just like `execa()`, this can use the [template string syntax](execution.md#template-string-syntax) or [bind options](execution.md#globalshared-options). It can also be [run synchronously](#execasyncfile-arguments-options) using `$.sync()` or `$.s()`.6566This is the preferred method when executing multiple commands in a script file.6768[More info.](scripts.md)6970### execaNode(scriptPath, arguments?, options?)7172`scriptPath`: `string | URL`\73`arguments`: `string[]`\74`options`: [`Options`](#options)\Rename some types (#1009)ehmickybefore adoption2ef9186
line 75why, one step back75_Returns_: [`ResultPromise`](#return-value)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 76–85why, one step back7677Same as [`execa()`](#execafile-arguments-options) but using the [`node: true`](#optionsnode) option.78Executes a Node.js file using `node scriptPath ...arguments`.7980Just like `execa()`, this can use the [template string syntax](execution.md#template-string-syntax) or [bind options](execution.md#globalshared-options).8182This is the preferred method when executing Node.js files.8384[More info.](node.md)85Add `parseCommandString()` (#1054)ehmickybefore adoptionb9474c3
line 86why, one step back86### parseCommandString(command)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 87–88why, one step back8788`command`: `string`\Add `parseCommandString()` (#1054)ehmickybefore adoptionb9474c3
line 89why, one step back89_Returns_: `string[]`Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 90why, one step back90Add `parseCommandString()` (#1054)ehmickybefore adoptionb9474c3
line 91why, one step back91Split a `command` string into an array. For example, `'npm run build'` returns `['npm', 'run', 'build']` and `'argument otherArgument'` returns `['argument', 'otherArgument']`.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 92–94why, one step back9293[More info.](escaping.md#user-defined-input)94Add `strict` option to `sendMessage()` (#1098)ehmickybefore adoptione085b10
line 95why, one step back95### sendMessage(message, sendMessageOptions?)Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 96–97why, one step back9697`message`: [`Message`](ipc.md#message-type)\Add `strict` option to `sendMessage()` (#1098)ehmickybefore adoptione085b10
line 98why, one step back98`sendMessageOptions`: [`SendMessageOptions`](#sendmessageoptions)\Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 99–106why, one step back99_Returns_: `Promise<void>`100101Send a `message` to the parent process.102103This requires the [`ipc`](#optionsipc) option to be `true`. The [type](ipc.md#message-type) of `message` depends on the [`serialization`](#optionsserialization) option.104105[More info.](ipc.md#exchanging-messages)106Add `strict` option to `sendMessage()` (#1098)ehmickybefore adoptione085b10
lines 107–119why, one step back107#### sendMessageOptions108109_Type_: `object`110111#### sendMessageOptions.strict112113_Type_: `boolean`\114_Default_: `false`115116Throw when the other process is not receiving or listening to messages.117118[More info.](ipc.md#ensure-messages-are-received)119Add `filter` option to `getOneMessage()` (#1076)ehmickybefore adoption571e052
line 120why, one step back120### getOneMessage(getOneMessageOptions?)Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 121why, one step back121Add `strict` option to `sendMessage()` (#1098)ehmickybefore adoptione085b10
line 122why, one step back122`getOneMessageOptions`: [`GetOneMessageOptions`](#getonemessageoptions)\Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 123–130why, one step back123_Returns_: [`Promise<Message>`](ipc.md#message-type)124125Receive a single `message` from the parent process.126127This requires the [`ipc`](#optionsipc) option to be `true`. The [type](ipc.md#message-type) of `message` depends on the [`serialization`](#optionsserialization) option.128129[More info.](ipc.md#exchanging-messages)130Add `filter` option to `getOneMessage()` (#1076)ehmickybefore adoption571e052
lines 131–142why, one step back131#### getOneMessageOptions132133_Type_: `object`134135#### getOneMessageOptions.filter136137_Type_: [`(Message) => boolean`](ipc.md#message-type)138139Ignore any `message` that returns `false`.140141[More info.](ipc.md#filter-messages)142Add `reference` option to `getOneMessage()` and `getEachMessage()` (#1107)ehmickybefore adoptionff02af6
line 143why, one step back143#### getOneMessageOptions.referenceAdd promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 144why, one step back144Add `reference` option to `getOneMessage()` and `getEachMessage()` (#1107)ehmickybefore adoptionff02af6
lines 145–154why, one step back145_Type_: `boolean`\146_Default_: `true`147148Keep the subprocess alive while `getOneMessage()` is waiting.149150[More info.](ipc.md#keeping-the-subprocess-alive)151152### getEachMessage(getEachMessageOptions?)153154`getEachMessageOptions`: [`GetEachMessageOptions`](#geteachmessageoptions)\Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 155–162why, one step back155_Returns_: [`AsyncIterable<Message>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)156157Iterate over each `message` from the parent process.158159This requires the [`ipc`](#optionsipc) option to be `true`. The [type](ipc.md#message-type) of `message` depends on the [`serialization`](#optionsserialization) option.160161[More info.](ipc.md#listening-to-messages)162Add `reference` option to `getOneMessage()` and `getEachMessage()` (#1107)ehmickybefore adoptionff02af6
lines 163–175why, one step back163#### getEachMessageOptions164165_Type_: `object`166167#### getEachMessageOptions.reference168169_Type_: `boolean`\170_Default_: `true`171172Keep the subprocess alive while `getEachMessage()` is waiting.173174[More info.](ipc.md#keeping-the-subprocess-alive)175Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 176why, one step back176## Return valueMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 177why, one step back177Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
lines 178–179why, one step back178_TypeScript:_ [`ResultPromise`](typescript.md)\179_Type:_ `Promise<object> | Subprocess`Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 180why, one step back180Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 181why, one step back181The return value of all [asynchronous methods](#methods) is both:Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
lines 182–183why, one step back182- the [subprocess](#subprocess).183- a `Promise` either resolving with its successful [`result`](#result), or rejecting with its [`error`](#execaerror).Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 184–186why, one step back184185[More info.](execution.md#subprocess)186Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
lines 187–188why, one step back187## Subprocess188Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 189why, one step back189_TypeScript:_ [`Subprocess`](typescript.md)Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
lines 190–192why, one step back190191[`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with the following methods and properties.192Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 193–235why, one step back193### subprocess\[Symbol.asyncIterator\]()194195_Returns_: [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)196197Subprocesses are [async iterables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator). They iterate over each output line.198199[More info.](lines.md#progressive-splitting)200201### subprocess.iterable(readableOptions?)202203`readableOptions`: [`ReadableOptions`](#readableoptions)\204_Returns_: [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)205206Same as [`subprocess[Symbol.asyncIterator]`](#subprocesssymbolasynciterator) except [options](#readableoptions) can be provided.207208[More info.](lines.md#progressive-splitting)209210### subprocess.pipe(file, arguments?, options?)211212`file`: `string | URL`\213`arguments`: `string[]`\214`options`: [`Options`](#options) and [`PipeOptions`](#pipeoptions)\215_Returns_: [`Promise<Result>`](#result)216217[Pipe](https://nodejs.org/api/stream.html#readablepipedestination-options) the subprocess' [`stdout`](#subprocessstdout) to a second Execa subprocess' [`stdin`](#subprocessstdin). This resolves with that second subprocess' [result](#result). If either subprocess is rejected, this is rejected with that subprocess' [error](#execaerror) instead.218219This follows the same syntax as [`execa(file, arguments?, options?)`](#execafile-arguments-options) except both [regular options](#options) and [pipe-specific options](#pipeoptions) can be specified.220221[More info.](pipe.md#array-syntax)222223### subprocess.pipe\`command\`224### subprocess.pipe(options)\`command\`225226`command`: `string`\227`options`: [`Options`](#options) and [`PipeOptions`](#pipeoptions)\228_Returns_: [`Promise<Result>`](#result)229230Like [`subprocess.pipe(file, arguments?, options?)`](#subprocesspipefile-arguments-options) but using a [`command` template string](scripts.md#piping-stdout-to-another-command) instead. This follows the same syntax as `execa` [template strings](execution.md#template-string-syntax).231232[More info.](pipe.md#template-string-syntax)233234### subprocess.pipe(secondSubprocess, pipeOptions?)235Rename some types (#1009)ehmickybefore adoption2ef9186
line 236why, one step back236`secondSubprocess`: [`ResultPromise`](#return-value)\Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 237–239why, one step back237`pipeOptions`: [`PipeOptions`](#pipeoptions)\238_Returns_: [`Promise<Result>`](#result)239Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 240why, one step back240Like [`subprocess.pipe(file, arguments?, options?)`](#subprocesspipefile-arguments-options) but using the [return value](#return-value) of another [`execa()`](#execafile-arguments-options) call instead.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 241–245why, one step back241242[More info.](pipe.md#advanced-syntax)243244#### pipeOptions245Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 246why, one step back246_Type:_ `object`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 247–249why, one step back247248#### pipeOptions.from249Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 250–251why, one step back250_Type:_ `"stdout" | "stderr" | "all" | "fd3" | "fd4" | ...`\251_Default:_ `"stdout"`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 252–260why, one step back252253Which stream to pipe from the source subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.254255`"all"` pipes both [`stdout`](#subprocessstdout) and [`stderr`](#subprocessstderr). This requires the [`all`](#optionsall) option to be `true`.256257[More info.](pipe.md#source-file-descriptor)258259#### pipeOptions.to260Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 261–262why, one step back261_Type:_ `"stdin" | "fd3" | "fd4" | ...`\262_Default:_ `"stdin"`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 263–269why, one step back263264Which [stream](#subprocessstdin) to pipe to the destination subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.265266[More info.](pipe.md#destination-file-descriptor)267268#### pipeOptions.unpipeSignal269Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 270why, one step back270_Type:_ [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 271–282why, one step back271272Unpipe the subprocess when the signal aborts.273274[More info.](pipe.md#unpipe)275276### subprocess.kill(signal, error?)277### subprocess.kill(error?)278279`signal`: `string | number`\280`error`: `Error`\281_Returns_: `boolean`282Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 283why, one step back283Sends a [signal](https://nodejs.org/api/os.html#signal-constants) to the subprocess. The default signal is the [`killSignal`](#optionskillsignal) option. `killSignal` defaults to `SIGTERM`, which [terminates](#erroristerminated) the subprocess.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 284–292why, one step back284285This returns `false` when the signal could not be sent, for example when the subprocess has already exited.286287When an error is passed as argument, it is set to the subprocess' [`error.cause`](#errorcause). The subprocess is then terminated with the default signal. This does not emit the [`error` event](https://nodejs.org/api/child_process.html#event-error).288289[More info.](termination.md)290291### subprocess.pid292Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 293why, one step back293_Type:_ `number | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 294–300why, one step back294295Process identifier ([PID](https://en.wikipedia.org/wiki/Process_identifier)).296297This is `undefined` if the subprocess failed to spawn.298299[More info.](termination.md#inter-process-termination)300Add `strict` option to `sendMessage()` (#1098)ehmickybefore adoptione085b10
line 301why, one step back301### subprocess.sendMessage(message, sendMessageOptions)Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 302why, one step back302Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 303why, one step back303`message`: [`Message`](ipc.md#message-type)\Add `strict` option to `sendMessage()` (#1098)ehmickybefore adoptione085b10
line 304why, one step back304`sendMessageOptions`: [`SendMessageOptions`](#sendmessageoptions)\Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 305why, one step back305_Returns_: `Promise<void>`Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 306why, one step back306Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 307why, one step back307Send a `message` to the subprocess.Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 308why, one step back308Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 309why, one step back309This requires the [`ipc`](#optionsipc) option to be `true`. The [type](ipc.md#message-type) of `message` depends on the [`serialization`](#optionsserialization) option.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 310–312why, one step back310311[More info.](ipc.md#exchanging-messages)312Add `filter` option to `getOneMessage()` (#1076)ehmickybefore adoption571e052
line 313why, one step back313### subprocess.getOneMessage(getOneMessageOptions?)Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 314why, one step back314Add `strict` option to `sendMessage()` (#1098)ehmickybefore adoptione085b10
line 315why, one step back315`getOneMessageOptions`: [`GetOneMessageOptions`](#getonemessageoptions)\Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 316why, one step back316_Returns_: [`Promise<Message>`](ipc.md#message-type)Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 317why, one step back317Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 318why, one step back318Receive a single `message` from the subprocess.Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 319why, one step back319Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 320why, one step back320This requires the [`ipc`](#optionsipc) option to be `true`. The [type](ipc.md#message-type) of `message` depends on the [`serialization`](#optionsserialization) option.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 321–323why, one step back321322[More info.](ipc.md#exchanging-messages)323Add `reference` option to `getOneMessage()` and `getEachMessage()` (#1107)ehmickybefore adoptionff02af6
line 324why, one step back324### subprocess.getEachMessage(getEachMessageOptions?)Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 325why, one step back325Add `reference` option to `getOneMessage()` and `getEachMessage()` (#1107)ehmickybefore adoptionff02af6
line 326why, one step back326`getEachMessageOptions`: [`GetEachMessageOptions`](#geteachmessageoptions)\Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 327–334why, one step back327_Returns_: [`AsyncIterable<Message>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)328329Iterate over each `message` from the subprocess.330331This requires the [`ipc`](#optionsipc) option to be `true`. The [type](ipc.md#message-type) of `message` depends on the [`serialization`](#optionsserialization) option.332333[More info.](ipc.md#listening-to-messages)334Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 335–336why, one step back335### subprocess.stdin336Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 337why, one step back337_Type:_ [`Writable | null`](https://nodejs.org/api/stream.html#class-streamwritable)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 338–346why, one step back338339The subprocess [`stdin`](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)) as a stream.340341This is `null` if the [`stdin`](#optionsstdin) option is set to [`'inherit'`](input.md#terminal-input), [`'ignore'`](input.md#ignore-input), [`Readable`](streams.md#input) or [`integer`](input.md#terminal-input).342343[More info.](streams.md#manual-streaming)344345### subprocess.stdout346Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 347why, one step back347_Type:_ [`Readable | null`](https://nodejs.org/api/stream.html#class-streamreadable)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 348–356why, one step back348349The subprocess [`stdout`](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)) as a stream.350351This is `null` if the [`stdout`](#optionsstdout) option is set to [`'inherit'`](output.md#terminal-output), [`'ignore'`](output.md#ignore-output), [`Writable`](streams.md#output) or [`integer`](output.md#terminal-output), or if the [`buffer`](#optionsbuffer) option is `false`.352353[More info.](streams.md#manual-streaming)354355### subprocess.stderr356Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 357why, one step back357_Type:_ [`Readable | null`](https://nodejs.org/api/stream.html#class-streamreadable)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 358–366why, one step back358359The subprocess [`stderr`](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)) as a stream.360361This is `null` if the [`stderr`](#optionsstdout) option is set to [`'inherit'`](output.md#terminal-output), [`'ignore'`](output.md#ignore-output), [`Writable`](streams.md#output) or [`integer`](output.md#terminal-output), or if the [`buffer`](#optionsbuffer) option is `false`.362363[More info.](streams.md#manual-streaming)364365### subprocess.all366Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 367why, one step back367_Type:_ [`Readable | undefined`](https://nodejs.org/api/stream.html#class-streamreadable)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 368–378why, one step back368369Stream combining/interleaving [`subprocess.stdout`](#subprocessstdout) and [`subprocess.stderr`](#subprocessstderr).370371This requires the [`all`](#optionsall) option to be `true`.372373This is `undefined` if [`stdout`](#optionsstdout) and [`stderr`](#optionsstderr) options are set to [`'inherit'`](output.md#terminal-output), [`'ignore'`](output.md#ignore-output), [`Writable`](streams.md#output) or [`integer`](output.md#terminal-output), or if the [`buffer`](#optionsbuffer) option is `false`.374375More info on [interleaving](output.md#interleaved-output) and [streaming](streams.md#manual-streaming).376377### subprocess.stdio378Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 379why, one step back379_Type:_ [`[Writable | null, Readable | null, Readable | null, ...Array<Writable | Readable | null>]`](https://nodejs.org/api/stream.html#class-streamreadable)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 380–397why, one step back380381The subprocess [`stdin`](#subprocessstdin), [`stdout`](#subprocessstdout), [`stderr`](#subprocessstderr) and [other files descriptors](#optionsstdio) as an array of streams.382383Each array item is `null` if the corresponding [`stdin`](#optionsstdin), [`stdout`](#optionsstdout), [`stderr`](#optionsstderr) or [`stdio`](#optionsstdio) option is set to [`'inherit'`](output.md#terminal-output), [`'ignore'`](output.md#ignore-output), [`Stream`](streams.md#output) or [`integer`](output.md#terminal-output), or if the [`buffer`](#optionsbuffer) option is `false`.384385[More info.](streams.md#manual-streaming)386387### subprocess.readable(readableOptions?)388389`readableOptions`: [`ReadableOptions`](#readableoptions)\390_Returns_: [`Readable`](https://nodejs.org/api/stream.html#class-streamreadable) Node.js stream391392Converts the subprocess to a readable stream.393394[More info.](streams.md#converting-a-subprocess-to-a-stream)395396#### readableOptions397Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 398why, one step back398_Type:_ `object`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 399–401why, one step back399400#### readableOptions.from401Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 402–403why, one step back402_Type:_ `"stdout" | "stderr" | "all" | "fd3" | "fd4" | ...`\403_Default:_ `"stdout"`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 404–412why, one step back404405Which stream to read from the subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.406407`"all"` reads both [`stdout`](#subprocessstdout) and [`stderr`](#subprocessstderr). This requires the [`all`](#optionsall) option to be `true`.408409[More info.](streams.md#different-file-descriptor)410411#### readableOptions.binary412Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 413–414why, one step back413_Type:_ `boolean`\414_Default:_ `false` with [`subprocess.iterable()`](#subprocessiterablereadableoptions), `true` with [`subprocess.readable()`](#subprocessreadablereadableoptions)/[`subprocess.duplex()`](#subprocessduplexduplexoptions)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 415–425why, one step back415416If `false`, iterates over lines. Each line is a string.417418If `true`, iterates over arbitrary chunks of data. Each line is an [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) (with [`subprocess.iterable()`](#subprocessiterablereadableoptions)) or a [`Buffer`](https://nodejs.org/api/buffer.html#class-buffer) (with [`subprocess.readable()`](#subprocessreadablereadableoptions)/[`subprocess.duplex()`](#subprocessduplexduplexoptions)).419420This is always `true` when the [`encoding`](#optionsencoding) option is binary.421422More info for [iterables](binary.md#iterable) and [streams](binary.md#streams).423424#### readableOptions.preserveNewlines425Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 426–427why, one step back426_Type:_ `boolean`\427_Default:_ `false` with [`subprocess.iterable()`](#subprocessiterablereadableoptions), `true` with [`subprocess.readable()`](#subprocessreadablereadableoptions)/[`subprocess.duplex()`](#subprocessduplexduplexoptions)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 428–443why, one step back428429If both this option and the [`binary`](#readableoptionsbinary) option is `false`, [newlines](https://en.wikipedia.org/wiki/Newline) are stripped from each line.430431[More info.](lines.md#iterable)432433### subprocess.writable(writableOptions?)434435`writableOptions`: [`WritableOptions`](#writableoptions)\436_Returns_: [`Writable`](https://nodejs.org/api/stream.html#class-streamwritable) Node.js stream437438Converts the subprocess to a writable stream.439440[More info.](streams.md#converting-a-subprocess-to-a-stream)441442#### writableOptions443Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 444why, one step back444_Type:_ `object`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 445–447why, one step back445446#### writableOptions.to447Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 448–449why, one step back448_Type:_ `"stdin" | "fd3" | "fd4" | ...`\449_Default:_ `"stdin"`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 450–465why, one step back450451Which [stream](#subprocessstdin) to write to the subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.452453[More info.](streams.md#different-file-descriptor)454455### subprocess.duplex(duplexOptions?)456457`duplexOptions`: [`ReadableOptions | WritableOptions`](#readableoptions)\458_Returns_: [`Duplex`](https://nodejs.org/api/stream.html#class-streamduplex) Node.js stream459460Converts the subprocess to a duplex stream.461462[More info.](streams.md#converting-a-subprocess-to-a-stream)463464## Result465Improve documentation of signal handling (#1105)ehmickybefore adoption01a4b42
line 466why, one step back466_TypeScript:_ [`Result`](typescript.md) or [`SyncResult`](typescript.md)\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 467why, one step back467_Type:_ `object`Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 468why, one step back468Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 469why, one step back469[Result](execution.md#result) of a subprocess successful execution.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 470–474why, one step back470471When the subprocess [fails](errors.md#subprocess-failure), it is rejected with an [`ExecaError`](#execaerror) instead.472473### result.stdout474Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 475why, one step back475_Type:_ `string | Uint8Array | string[] | Uint8Array[] | unknown[] | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 476–486why, one step back476477The output of the subprocess on [`stdout`](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)).478479This is `undefined` if the [`stdout`](#optionsstdout) option is set to only [`'inherit'`](output.md#terminal-output), [`'ignore'`](output.md#ignore-output), [`Writable`](streams.md#output) or [`integer`](output.md#terminal-output), or if the [`buffer`](#optionsbuffer) option is `false`.480481This is an array if the [`lines`](#optionslines) option is `true`, or if the `stdout` option is a [transform in object mode](transform.md#object-mode).482483[More info.](output.md#stdout-and-stderr)484485### result.stderr486Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 487why, one step back487_Type:_ `string | Uint8Array | string[] | Uint8Array[] | unknown[] | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 488–498why, one step back488489The output of the subprocess on [`stderr`](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)).490491This is `undefined` if the [`stderr`](#optionsstderr) option is set to only [`'inherit'`](output.md#terminal-output), [`'ignore'`](output.md#ignore-output), [`Writable`](streams.md#output) or [`integer`](output.md#terminal-output), or if the [`buffer`](#optionsbuffer) option is `false`.492493This is an array if the [`lines`](#optionslines) option is `true`, or if the `stderr` option is a [transform in object mode](transform.md#object-mode).494495[More info.](output.md#stdout-and-stderr)496497### result.all498Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 499why, one step back499_Type:_ `string | Uint8Array | string[] | Uint8Array[] | unknown[] | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 500–512why, one step back500501The output of the subprocess with [`result.stdout`](#resultstdout) and [`result.stderr`](#resultstderr) interleaved.502503This requires the [`all`](#optionsall) option to be `true`.504505This is `undefined` if both [`stdout`](#optionsstdout) and [`stderr`](#optionsstderr) options are set to only [`'inherit'`](output.md#terminal-output), [`'ignore'`](output.md#ignore-output), [`Writable`](streams.md#output) or [`integer`](output.md#terminal-output), or if the [`buffer`](#optionsbuffer) option is `false`.506507This is an array if the [`lines`](#optionslines) option is `true`, or if either the `stdout` or `stderr` option is a [transform in object mode](transform.md#object-mode).508509[More info.](output.md#interleaved-output)510511### result.stdio512Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 513why, one step back513_Type:_ `Array<string | Uint8Array | string[] | Uint8Array[] | unknown[] | undefined>`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 514–522why, one step back514515The output of the subprocess on [`stdin`](#optionsstdin), [`stdout`](#optionsstdout), [`stderr`](#optionsstderr) and [other file descriptors](#optionsstdio).516517Items are `undefined` when their corresponding [`stdio`](#optionsstdio) option is set to [`'inherit'`](output.md#terminal-output), [`'ignore'`](output.md#ignore-output), [`Writable`](streams.md#output) or [`integer`](output.md#terminal-output), or if the [`buffer`](#optionsbuffer) option is `false`.518519Items are arrays when their corresponding `stdio` option is a [transform in object mode](transform.md#object-mode).520521[More info.](output.md#additional-file-descriptors)522Rename `result.ipc` to `result.ipcOutput` (#1075)ehmickybefore adoptionae9b360
line 523why, one step back523### result.ipcOutputAdd `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de
line 524why, one step back524Fix type of `result.ipc` (#1071)ehmickybefore adoption69152ec
line 525why, one step back525_Type_: [`Message[]`](ipc.md#message-type)Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de
line 526why, one step back526Add `strict` option to `sendMessage()` (#1098)ehmickybefore adoptione085b10
line 527why, one step back527All the messages [sent by the subprocess](#sendmessagemessage-sendmessageoptions) to the current process.Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de
lines 528–532why, one step back528529This is empty unless the [`ipc`](#optionsipc) option is `true`. Also, this is empty if the [`buffer`](#optionsbuffer) option is `false`.530531[More info.](ipc.md#retrieve-all-messages)532Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 533–534why, one step back533### result.pipedFrom534Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 535why, one step back535_Type:_ [`Array<Result | ExecaError>`](#result)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 536–544why, one step back536537[Results](#result) of the other subprocesses that were piped into this subprocess.538539This array is initially empty and is populated each time the [`subprocess.pipe()`](#subprocesspipefile-arguments-options) method resolves.540541[More info.](pipe.md#result)542543### result.command544Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 545why, one step back545_Type:_ `string`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 546–552why, one step back546547The file and [arguments](input.md#command-arguments) that were run.548549[More info.](debugging.md#command)550551### result.escapedCommand552Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 553why, one step back553_Type:_ `string`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 554–560why, one step back554555Same as [`command`](#resultcommand) but escaped.556557[More info.](debugging.md#command)558559### result.cwd560Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 561why, one step back561_Type:_ `string`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 562–568why, one step back562563The [current directory](#optionscwd) in which the command was run.564565[More info.](environment.md#current-directory)566567### result.durationMs568Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 569why, one step back569_Type:_ `number`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 570–576why, one step back570571Duration of the subprocess, in milliseconds.572573[More info.](debugging.md#duration)574575### result.failed576Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 577why, one step back577_Type:_ `boolean`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 578–580why, one step back578579Whether the subprocess failed to run.580Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 581–582why, one step back581When this is `true`, the result is an [`ExecaError`](#execaerror) instance with additional error-related properties.582Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 583–584why, one step back583[More info.](errors.md#subprocess-failure)584Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 585–586why, one step back585## ExecaError586## ExecaSyncErrorMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 587why, one step back587Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 588why, one step back588_Type:_ `Error`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 589–599why, one step back589590Result of a subprocess [failed execution](errors.md#subprocess-failure).591592This error is thrown as an exception. If the [`reject`](#optionsreject) option is false, it is returned instead.593594This has the same shape as [successful results](#result), with the following additional properties.595596[More info.](errors.md)597598### error.message599Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 600why, one step back600_Type:_ `string`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 601–607why, one step back601602Error message when the subprocess [failed](errors.md#subprocess-failure) to run.603604[More info.](errors.md#error-message)605606### error.shortMessage607Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 608why, one step back608_Type:_ `string`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 609–615why, one step back609610This is the same as [`error.message`](#errormessage) except it does not include the subprocess [output](output.md).611612[More info.](errors.md#error-message)613614### error.originalMessage615Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 616why, one step back616_Type:_ `string | undefined`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 617–623why, one step back617618Original error message. This is the same as [`error.message`](#errormessage) excluding the subprocess [output](output.md) and some additional information added by Execa.619620[More info.](errors.md#error-message)621622### error.cause623Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 624why, one step back624_Type:_ `unknown | undefined`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 625–633why, one step back625626Underlying error, if there is one. For example, this is set by [`subprocess.kill(error)`](#subprocesskillerror).627628This is usually an `Error` instance.629630[More info.](termination.md#error-message-and-stack-trace)631632### error.code633Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 634why, one step back634_Type:_ `string | undefined`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 635–639why, one step back635636Node.js-specific [error code](https://nodejs.org/api/errors.html#errorcode), when available.637638### error.timedOut639Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 640why, one step back640_Type:_ `boolean`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 641–645why, one step back641642Whether the subprocess timed out due to the [`timeout`](#optionstimeout) option.643644[More info.](termination.md#timeout)645Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 646why, one step back646### error.isCanceledMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 647why, one step back647Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 648why, one step back648_Type:_ `boolean`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 649–653why, one step back649650Whether the subprocess was canceled using the [`cancelSignal`](#optionscancelsignal) option.651652[More info.](termination.md#canceling)653Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 654why, one step back654### error.isMaxBufferMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 655why, one step back655Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 656why, one step back656_Type:_ `boolean`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 657–661why, one step back657658Whether the subprocess failed because its output was larger than the [`maxBuffer`](#optionsmaxbuffer) option.659660[More info.](output.md#big-output)661Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 662why, one step back662### error.isTerminatedMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 663why, one step back663Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 664why, one step back664_Type:_ `boolean`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 665–671why, one step back665666Whether the subprocess was terminated by a [signal](termination.md#signal-termination) (like [`SIGTERM`](termination.md#sigterm)) sent by either:667- The current process.668- [Another process](termination.md#inter-process-termination). This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).669670[More info.](termination.md#signal-name-and-description)671Add `error.isForcefullyTerminated` (#1111)ehmickybefore adoptione69985d
lines 672–679why, one step back672### error.isForcefullyTerminated673674_Type:_ `boolean`675676Whether the subprocess was terminated by the [`SIGKILL`](termination.md#sigkill) signal sent by the [`forceKillAfterDelay`](#optionsforcekillafterdelay) option.677678[More info.](termination.md#forceful-termination)679Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 680why, one step back680### error.exitCodeMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 681why, one step back681Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 682why, one step back682_Type:_ `number | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 683–685why, one step back683684The numeric [exit code](https://en.wikipedia.org/wiki/Exit_status) of the subprocess that was run.685Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 686why, one step back686This is `undefined` when the subprocess could not be spawned or was terminated by a [signal](#errorsignal).Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 687–689why, one step back687688[More info.](errors.md#exit-code)689Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 690why, one step back690### error.signalMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 691why, one step back691Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 692why, one step back692_Type:_ `string | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 693–701why, one step back693694The name of the [signal](termination.md#signal-termination) (like [`SIGTERM`](termination.md#sigterm)) that terminated the subprocess, sent by either:695- The current process.696- [Another process](termination.md#inter-process-termination). This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).697698If a signal terminated the subprocess, this property is defined and included in the [error message](#errormessage). Otherwise it is `undefined`.699700[More info.](termination.md#signal-name-and-description)701Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 702why, one step back702### error.signalDescriptionMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 703why, one step back703Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 704why, one step back704_Type:_ `string | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 705–713why, one step back705706A human-friendly description of the [signal](termination.md#signal-termination) that was used to terminate the subprocess.707708If a signal terminated the subprocess, this property is defined and included in the error message. Otherwise it is `undefined`. It is also `undefined` when the signal is very uncommon which should seldomly happen.709710[More info.](termination.md#signal-name-and-description)711712## Options713Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 714why, one step back714_TypeScript:_ [`Options`](typescript.md) or [`SyncOptions`](typescript.md\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 715why, one step back715_Type:_ `object`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 716–722why, one step back716717This lists all options for [`execa()`](#execafile-arguments-options) and the [other methods](#methods).718719The following options [can specify different values](output.md#stdoutstderr-specific-options) for [`stdout`](#optionsstdout) and [`stderr`](#optionsstderr): [`verbose`](#optionsverbose), [`lines`](#optionslines), [`stripFinalNewline`](#optionsstripfinalnewline), [`buffer`](#optionsbuffer), [`maxBuffer`](#optionsmaxbuffer).720721### options.preferLocal722Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 723–724why, one step back723_Type:_ `boolean`\724_Default:_ `true` with [`$`](#file-arguments-options), `false` otherwiseMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 725–731why, one step back725726Prefer locally installed binaries when looking for a binary to execute.727728[More info.](environment.md#local-binaries)729730### options.localDir731Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 732–733why, one step back732_Type:_ `string | URL`\733_Default:_ [`cwd`](#optionscwd) optionMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 734–740why, one step back734735Preferred path to find locally installed binaries, when using the [`preferLocal`](#optionspreferlocal) option.736737[More info.](environment.md#local-binaries)738739### options.node740Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 741–742why, one step back741_Type:_ `boolean`\742_Default:_ `true` with [`execaNode()`](#execanodescriptpath-arguments-options), `false` otherwiseMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 743–745why, one step back743744If `true`, runs with Node.js. The first argument must be a Node.js file.745Improve the documentation of the `node`/`nodePath`/`nodeOptions` options (#1011)ehmickybefore adoption4878db5
lines 746–747why, one step back746The subprocess inherits the current Node.js [CLI flags](https://nodejs.org/api/cli.html#options) and version. This can be overridden using the [`nodeOptions`](#optionsnodeoptions) and [`nodePath`](#optionsnodepath) options.747Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 748–751why, one step back748[More info.](node.md)749750### options.nodeOptions751Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 752why, one step back752_Type:_ `string[]`\Improve the documentation of the `node`/`nodePath`/`nodeOptions` options (#1011)ehmickybefore adoption4878db5
line 753why, one step back753_Default:_ [`process.execArgv`](https://nodejs.org/api/process.html#process_process_execargv) (current Node.js CLI flags)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 754–762why, one step back754755List of [CLI flags](https://nodejs.org/api/cli.html#cli_options) passed to the [Node.js executable](#optionsnodepath).756757Requires the [`node`](#optionsnode) option to be `true`.758759[More info.](node.md#nodejs-cli-flags)760761### options.nodePath762Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 763–764why, one step back763_Type:_ `string | URL`\764_Default:_ [`process.execPath`](https://nodejs.org/api/process.html#process_process_execpath) (current Node.js executable)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 765–773why, one step back765766Path to the Node.js executable.767768Requires the [`node`](#optionsnode) option to be `true`.769770[More info.](node.md#nodejs-version)771772### options.shell773Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 774–775why, one step back774_Type:_ `boolean | string | URL`\775_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 776–786why, one step back776777If `true`, runs the command inside of a [shell](https://en.wikipedia.org/wiki/Shell_(computing)).778779Uses [`/bin/sh`](https://en.wikipedia.org/wiki/Unix_shell) on UNIX and [`cmd.exe`](https://en.wikipedia.org/wiki/Cmd.exe) on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.780781We [recommend against](shell.md#avoiding-shells) using this option.782783[More info.](shell.md)784785### options.cwd786Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 787–788why, one step back787_Type:_ `string | URL`\788_Default:_ `process.cwd()`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 789–797why, one step back789790Current [working directory](https://en.wikipedia.org/wiki/Working_directory) of the subprocess.791792This is also used to resolve the [`nodePath`](#optionsnodepath) option when it is a relative path.793794[More info.](environment.md#current-directory)795796### options.env797Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 798–799why, one step back798_Type:_ `object`\799_Default:_ [`process.env`](https://nodejs.org/api/process.html#processenv)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 800–808why, one step back800801[Environment variables](https://en.wikipedia.org/wiki/Environment_variable).802803Unless the [`extendEnv`](#optionsextendenv) option is `false`, the subprocess also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).804805[More info.](input.md#environment-variables)806807### options.extendEnv808Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 809–810why, one step back809_Type:_ `boolean`\810_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 811–818why, one step back811812If `true`, the subprocess uses both the [`env`](#optionsenv) option and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).813If `false`, only the `env` option is used, not `process.env`.814815[More info.](input.md#environment-variables)816817### options.input818Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 819why, one step back819_Type:_ `string | Uint8Array | stream.Readable`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 820–828why, one step back820821Write some input to the subprocess' [`stdin`](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)).822823See also the [`inputFile`](#optionsinputfile) and [`stdin`](#optionsstdin) options.824825[More info.](input.md#string-input)826827### options.inputFile828Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 829why, one step back829_Type:_ `string | URL`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 830–838why, one step back830831Use a file as input to the subprocess' [`stdin`](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)).832833See also the [`input`](#optionsinput) and [`stdin`](#optionsstdin) options.834835[More info.](input.md#file-input)836837### options.stdin838Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 839why, one step back839_TypeScript:_ [`StdinOption`](typescript.md) or [`StdinSyncOption`](typescript.md)\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 840–841why, one step back840_Type:_ `string | number | stream.Readable | ReadableStream | TransformStream | URL | {file: string} | Uint8Array | Iterable<string | Uint8Array | unknown> | AsyncIterable<string | Uint8Array | unknown> | GeneratorFunction<string | Uint8Array | unknown> | AsyncGeneratorFunction<string | Uint8Array | unknown> | {transform: GeneratorFunction | AsyncGeneratorFunction | Duplex | TransformStream}` (or a tuple of those types)\841_Default:_ `'inherit'` with [`$`](#file-arguments-options), `'pipe'` otherwiseMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 842–850why, one step back842843How to setup the subprocess' [standard input](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)). This can be [`'pipe'`](streams.md#manual-streaming), [`'overlapped'`](windows.md#asynchronous-io), [`'ignore`](input.md#ignore-input), [`'inherit'`](input.md#terminal-input), a [file descriptor integer](input.md#terminal-input), a [Node.js `Readable` stream](streams.md#input), a web [`ReadableStream`](streams.md#web-streams), a [`{ file: 'path' }` object](input.md#file-input), a [file URL](input.md#file-input), an [`Iterable`](streams.md#iterables-as-input) (including an [array of strings](input.md#string-input)), an [`AsyncIterable`](streams.md#iterables-as-input), an [`Uint8Array`](binary.md#binary-input), a [generator function](transform.md), a [`Duplex`](transform.md#duplextransform-streams) or a web [`TransformStream`](transform.md#duplextransform-streams).844845This can be an [array of values](output.md#multiple-targets) such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.846847More info on [available values](input.md), [streaming](streams.md) and [transforms](transform.md).848849### options.stdout850Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 851why, one step back851_TypeScript:_ [`StdoutStderrOption`](typescript.md) or [`StdoutStderrSyncOption`](typescript.md)\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 852–853why, one step back852_Type:_ `string | number | stream.Writable | WritableStream | TransformStream | URL | {file: string} | GeneratorFunction<string | Uint8Array | unknown> | AsyncGeneratorFunction<string | Uint8Array | unknown> | {transform: GeneratorFunction | AsyncGeneratorFunction | Duplex | TransformStream}` (or a tuple of those types)\853_Default:_ `pipe`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 854–862why, one step back854855How to setup the subprocess' [standard output](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)). This can be [`'pipe'`](output.md#stdout-and-stderr), [`'overlapped'`](windows.md#asynchronous-io), [`'ignore`](output.md#ignore-output), [`'inherit'`](output.md#terminal-output), a [file descriptor integer](output.md#terminal-output), a [Node.js `Writable` stream](streams.md#output), a web [`WritableStream`](streams.md#web-streams), a [`{ file: 'path' }` object](output.md#file-output), a [file URL](output.md#file-output), a [generator function](transform.md), a [`Duplex`](transform.md#duplextransform-streams) or a web [`TransformStream`](transform.md#duplextransform-streams).856857This can be an [array of values](output.md#multiple-targets) such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.858859More info on [available values](output.md), [streaming](streams.md) and [transforms](transform.md).860861### options.stderr862Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 863why, one step back863_TypeScript:_ [`StdoutStderrOption`](typescript.md) or [`StdoutStderrSyncOption`](typescript.md)\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 864–865why, one step back864_Type:_ `string | number | stream.Writable | WritableStream | TransformStream | URL | {file: string} | GeneratorFunction<string | Uint8Array | unknown> | AsyncGeneratorFunction<string | Uint8Array | unknown> | {transform: GeneratorFunction | AsyncGeneratorFunction | Duplex | TransformStream}` (or a tuple of those types)\865_Default:_ `pipe`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 866–874why, one step back866867How to setup the subprocess' [standard error](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)). This can be [`'pipe'`](output.md#stdout-and-stderr), [`'overlapped'`](windows.md#asynchronous-io), [`'ignore`](output.md#ignore-output), [`'inherit'`](output.md#terminal-output), a [file descriptor integer](output.md#terminal-output), a [Node.js `Writable` stream](streams.md#output), a web [`WritableStream`](streams.md#web-streams), a [`{ file: 'path' }` object](output.md#file-output), a [file URL](output.md#file-output), a [generator function](transform.md), a [`Duplex`](transform.md#duplextransform-streams) or a web [`TransformStream`](transform.md#duplextransform-streams).868869This can be an [array of values](output.md#multiple-targets) such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.870871More info on [available values](output.md), [streaming](streams.md) and [transforms](transform.md).872873### options.stdio874Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 875why, one step back875_TypeScript:_ [`Options['stdio']`](typescript.md) or [`SyncOptions['stdio']`](typescript.md)\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 876–877why, one step back876_Type:_ `string | Array<string | number | stream.Readable | stream.Writable | ReadableStream | WritableStream | TransformStream | URL | {file: string} | Uint8Array | Iterable<string> | Iterable<Uint8Array> | Iterable<unknown> | AsyncIterable<string | Uint8Array | unknown> | GeneratorFunction<string | Uint8Array | unknown> | AsyncGeneratorFunction<string | Uint8Array | unknown> | {transform: GeneratorFunction | AsyncGeneratorFunction | Duplex | TransformStream}>` (or a tuple of those types)\877_Default:_ `pipe`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 878–888why, one step back878879Like the [`stdin`](#optionsstdin), [`stdout`](#optionsstdout) and [`stderr`](#optionsstderr) options but for all [file descriptors](https://en.wikipedia.org/wiki/File_descriptor) at once. For example, `{stdio: ['ignore', 'pipe', 'pipe']}` is the same as `{stdin: 'ignore', stdout: 'pipe', stderr: 'pipe'}`.880881A single string can be used [as a shortcut](output.md#shortcut).882883The array can have more than 3 items, to create [additional file descriptors](output.md#additional-file-descriptors) beyond [`stdin`](#optionsstdin)/[`stdout`](#optionsstdout)/[`stderr`](#optionsstderr).884885More info on [available values](output.md), [streaming](streams.md) and [transforms](transform.md).886887### options.all888Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 889–890why, one step back889_Type:_ `boolean`\890_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 891–897why, one step back891892Add a [`subprocess.all`](#subprocessall) stream and a [`result.all`](#resultall) property.893894[More info.](output.md#interleaved-output)895896### options.encoding897Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 898–899why, one step back898_Type:_ `'utf8' | 'utf16le' | 'buffer' | 'hex' | 'base64' | 'base64url' | 'latin1' | 'ascii'`\899_Default:_ `'utf8'`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 900–912why, one step back900901If the subprocess outputs text, specifies its character encoding, either [`'utf8'`](https://en.wikipedia.org/wiki/UTF-8) or [`'utf16le'`](https://en.wikipedia.org/wiki/UTF-16).902903If it outputs binary data instead, this should be either:904- `'buffer'`: returns the binary output as an [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array).905- [`'hex'`](https://en.wikipedia.org/wiki/Hexadecimal), [`'base64'`](https://en.wikipedia.org/wiki/Base64), [`'base64url'`](https://en.wikipedia.org/wiki/Base64#URL_applications), [`'latin1'`](https://nodejs.org/api/buffer.html#buffers-and-character-encodings) or [`'ascii'`](https://nodejs.org/api/buffer.html#buffers-and-character-encodings): encodes the binary output as a string.906907The output is available with [`result.stdout`](#resultstdout), [`result.stderr`](#resultstderr) and [`result.stdio`](#resultstdio).908909[More info.](binary.md)910911### options.lines912Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 913–914why, one step back913_Type:_ `boolean`\914_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 915–925why, one step back915916Set [`result.stdout`](#resultstdout), [`result.stderr`](#resultstdout), [`result.all`](#resultall) and [`result.stdio`](#resultstdio) as arrays of strings, splitting the subprocess' output into lines.917918This cannot be used if the [`encoding`](#optionsencoding) option is [binary](binary.md#binary-output).919920By default, this applies to both `stdout` and `stderr`, but [different values can also be passed](output.md#stdoutstderr-specific-options).921922[More info.](lines.md#simple-splitting)923924### options.stripFinalNewline925Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 926–927why, one step back926_Type:_ `boolean`\927_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 928–938why, one step back928929Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from the output.930931If the [`lines`](#optionslines) option is true, this applies to each output line instead.932933By default, this applies to both `stdout` and `stderr`, but [different values can also be passed](output.md#stdoutstderr-specific-options).934935[More info.](lines.md#newlines)936937### options.maxBuffer938Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 939–940why, one step back939_Type:_ `number`\940_Default:_ `100_000_000`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 941–949why, one step back941942Largest amount of data allowed on [`stdout`](#resultstdout), [`stderr`](#resultstderr) and [`stdio`](#resultstdio).943944By default, this applies to both `stdout` and `stderr`, but [different values can also be passed](output.md#stdoutstderr-specific-options).945946[More info.](output.md#big-output)947948### options.buffer949Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 950–951why, one step back950_Type:_ `boolean`\951_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 952–960why, one step back952953When `buffer` is `false`, the [`result.stdout`](#resultstdout), [`result.stderr`](#resultstderr), [`result.all`](#resultall) and [`result.stdio`](#resultstdio) properties are not set.954955By default, this applies to both `stdout` and `stderr`, but [different values can also be passed](output.md#stdoutstderr-specific-options).956957[More info.](output.md#low-memory)958959### options.ipc960Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 961why, one step back961_Type:_ `boolean`\Add `ipcInput` option (#1068)ehmickybefore adoption46cae30
line 962why, one step back962_Default:_ `true` if either the [`node`](#optionsnode) option or the [`ipcInput`](#optionsipcinput) is set, `false` otherwiseMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 963why, one step back963Add `strict` option to `sendMessage()` (#1098)ehmickybefore adoptione085b10
line 964why, one step back964Enables exchanging messages with the subprocess using [`subprocess.sendMessage(message)`](#subprocesssendmessagemessage-sendmessageoptions), [`subprocess.getOneMessage()`](#subprocessgetonemessagegetonemessageoptions) and [`subprocess.getEachMessage()`](#subprocessgeteachmessage).Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 965why, one step back965Add `ipcInput` option (#1068)ehmickybefore adoption46cae30
lines 966–967why, one step back966The subprocess must be a Node.js file.967Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 968–971why, one step back968[More info.](ipc.md)969970### options.serialization971Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 972–973why, one step back972_Type:_ `'json' | 'advanced'`\973_Default:_ `'advanced'`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 974–977why, one step back974975Specify the kind of serialization used for sending messages between subprocesses when using the [`ipc`](#optionsipc) option.976977[More info.](ipc.md#message-type)Add `ipcInput` option (#1068)ehmickybefore adoption46cae30
lines 978–987why, one step back978979### options.ipcInput980981_Type_: [`Message`](ipc.md#message-type)982983Sends an IPC message when the subprocess starts.984985The subprocess must be a [Node.js file](#optionsnode). The value's [type](ipc.md#message-type) depends on the [`serialization`](#optionsserialization) option.986987More info [here](ipc.md#send-an-initial-message) and [there](input.md#any-input-type).Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 988–990why, one step back988989### options.verbose990Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 991–992why, one step back991_Type:_ `'none' | 'short' | 'full'`\992_Default:_ `'none'`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 993–995why, one step back993994If `verbose` is `'short'`, prints the command on [`stderr`](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)): its file, arguments, duration and (if it failed) error message.995Log IPC messages with `verbose: 'full'` (#1063)ehmickybefore adoption839c2fe
line 996why, one step back996If `verbose` is `'full'`, the command's [`stdout`](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)), `stderr` and [IPC messages](ipc.md) are also printed.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 997–1003why, one step back997998By default, this applies to both `stdout` and `stderr`, but [different values can also be passed](output.md#stdoutstderr-specific-options).9991000[More info.](debugging.md#verbose-mode)10011002### options.reject1003Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1004–1005why, one step back1004_Type:_ `boolean`\1005_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 1006why, one step back1006Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 1007why, one step back1007Setting this to `false` resolves the [result's promise](#return-value) with the [error](#execaerror) instead of rejecting it.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1008–1012why, one step back10081009[More info.](errors.md#preventing-exceptions)10101011### options.timeout1012Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1013–1014why, one step back1013_Type:_ `number`\1014_Default:_ `0`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1015–1017why, one step back10151016If `timeout` is greater than `0`, the subprocess will be [terminated](#optionskillsignal) if it runs for longer than that amount of milliseconds.1017Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 1018why, one step back1018On timeout, [`result.timedOut`](#errortimedout) becomes `true`.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1019–1023why, one step back10191020[More info.](termination.md#timeout)10211022### options.cancelSignal1023Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 1024why, one step back1024_Type:_ [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1025–1027why, one step back10251026You can abort the subprocess using [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).1027Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 1028why, one step back1028When `AbortController.abort()` is called, [`result.isCanceled`](#erroriscanceled) becomes `true`.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1029–1033why, one step back10291030[More info.](termination.md#canceling)10311032### options.forceKillAfterDelay1033Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1034–1035why, one step back1034_Type:_ `number | false`\1035_Default:_ `5000`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1036–1037why, one step back10361037If the subprocess is terminated but does not exit, forcefully exit it by sending [`SIGKILL`](https://en.wikipedia.org/wiki/Signal_(IPC)#SIGKILL).Add `error.isForcefullyTerminated` (#1111)ehmickybefore adoptione69985d
lines 1038–1039why, one step back10381039When this happens, [`error.isForcefullyTerminated`](#errorisforcefullyterminated) becomes `true`.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1040–1044why, one step back10401041[More info.](termination.md#forceful-termination)10421043### options.killSignal1044Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1045–1046why, one step back1045_Type:_ `string | number`\1046_Default:_ `'SIGTERM'`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1047–1055why, one step back10471048Default [signal](https://en.wikipedia.org/wiki/Signal_(IPC)) used to terminate the subprocess.10491050This can be either a name (like [`'SIGTERM'`](termination.md#sigterm)) or a number (like `9`).10511052[More info.](termination.md#default-signal)10531054### options.detached1055Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1056–1057why, one step back1056_Type:_ `boolean`\1057_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1058–1064why, one step back10581059Run the subprocess independently from the current process.10601061[More info.](environment.md#background-subprocess)10621063### options.cleanup1064Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1065–1066why, one step back1065_Type:_ `boolean`\1066_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1067–1073why, one step back10671068Kill the subprocess when the current process exits.10691070[More info.](termination.md#current-process-exit)10711072### options.uid1073Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1074–1075why, one step back1074_Type:_ `number`\1075_Default:_ current user identifierMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1076–1082why, one step back10761077Sets the [user identifier](https://en.wikipedia.org/wiki/User_identifier) of the subprocess.10781079[More info.](windows.md#uid-and-gid)10801081### options.gid1082Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1083–1084why, one step back1083_Type:_ `number`\1084_Default:_ current group identifierMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1085–1091why, one step back10851086Sets the [group identifier](https://en.wikipedia.org/wiki/Group_identifier) of the subprocess.10871088[More info.](windows.md#uid-and-gid)10891090### options.argv01091Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1092–1093why, one step back1092_Type:_ `string`\1093_Default:_ file being executedMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1094–1098why, one step back10941095Value of [`argv[0]`](https://nodejs.org/api/process.html#processargv0) sent to the subprocess.10961097### options.windowsHide1098Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1099–1100why, one step back1099_Type:_ `boolean`\1100_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1101–1107why, one step back11011102On Windows, do not create a new console window.11031104[More info.](windows.md#console-window)11051106### options.windowsVerbatimArguments1107Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1108–1109why, one step back1108_Type:_ `boolean`\1109_Default:_ `true` if the [`shell`](#optionsshell) option is `true`, `false` otherwiseMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1110–1124why, one step back11101111If `false`, escapes the command arguments on Windows.11121113[More info.](windows.md#cmdexe-escaping)11141115## Transform options11161117A transform or an [array of transforms](transform.md#combining) can be passed to the [`stdin`](#optionsstdin), [`stdout`](#optionsstdout), [`stderr`](#optionsstderr) or [`stdio`](#optionsstdio) option.11181119A transform is either a [generator function](#transformoptionstransform) or a plain object with the following members.11201121[More info.](transform.md)11221123### transformOptions.transform1124Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 1125why, one step back1125_Type:_ `GeneratorFunction<string | Uint8Array | unknown>` | `AsyncGeneratorFunction<string | Uint8Array | unknown>`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1126–1132why, one step back11261127Map or [filter](transform.md#filtering) the [input](input.md) or [output](output.md) of the subprocess.11281129More info [here](transform.md#summary) and [there](transform.md#sharing-state).11301131### transformOptions.final1132Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 1133why, one step back1133_Type:_ `GeneratorFunction<string | Uint8Array | unknown>` | `AsyncGeneratorFunction<string | Uint8Array | unknown>`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1134–1140why, one step back11341135Create additional lines after the last one.11361137[More info.](transform.md#finalizing)11381139### transformOptions.binary1140Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1141–1142why, one step back1141_Type:_ `boolean`\1142_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1143–1149why, one step back11431144If `true`, iterate over arbitrary chunks of `Uint8Array`s instead of line `string`s.11451146[More info.](binary.md#transforms)11471148### transformOptions.preserveNewlines1149Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1150–1151why, one step back1150_Type:_ `boolean`\1151_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1152–1158why, one step back11521153If `true`, keep newlines in each `line` argument. Also, this allows multiple `yield`s to produces a single line.11541155[More info.](lines.md#transforms)11561157### transformOptions.objectMode1158Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1159–1160why, one step back1159_Type:_ `boolean`\1160_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1161–1169why, one step back11611162If `true`, allow [`transformOptions.transform`](#transformoptionstransform) and [`transformOptions.final`](#transformoptionsfinal) to return any type, not just `string` or `Uint8Array`.11631164[More info.](transform.md#object-mode)11651166<hr>11671168[**Previous**: 🔍 Differences with Bash and zx](bash.md)\1169[**Top**: Table of contents](../readme.md#documentation)