api.md
This file
Path
docs/api.md
1,120 lines · 44.3 KiB · Markdown
Last changed by
Debounce `message` events (#1087)ehmickybefore adoptione8bab97
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 promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 95–105why, one step back95### sendMessage(message)9697`message`: [`Message`](ipc.md#message-type)\98_Returns_: `Promise<void>`99100Send a `message` to the parent process.101102This requires the [`ipc`](#optionsipc) option to be `true`. The [type](ipc.md#message-type) of `message` depends on the [`serialization`](#optionsserialization) option.103104[More info.](ipc.md#exchanging-messages)105Add `filter` option to `getOneMessage()` (#1076)ehmickybefore adoption571e052
line 106why, one step back106### getOneMessage(getOneMessageOptions?)Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 107why, one step back107Add `filter` option to `getOneMessage()` (#1076)ehmickybefore adoption571e052
line 108why, one step back108_getOneMessageOptions_: [`GetOneMessageOptions`](#getonemessageoptions)\Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 109–116why, one step back109_Returns_: [`Promise<Message>`](ipc.md#message-type)110111Receive a single `message` from the parent process.112113This requires the [`ipc`](#optionsipc) option to be `true`. The [type](ipc.md#message-type) of `message` depends on the [`serialization`](#optionsserialization) option.114115[More info.](ipc.md#exchanging-messages)116Add `filter` option to `getOneMessage()` (#1076)ehmickybefore adoption571e052
lines 117–128why, one step back117#### getOneMessageOptions118119_Type_: `object`120121#### getOneMessageOptions.filter122123_Type_: [`(Message) => boolean`](ipc.md#message-type)124125Ignore any `message` that returns `false`.126127[More info.](ipc.md#filter-messages)128Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 129–138why, one step back129### getEachMessage()130131_Returns_: [`AsyncIterable<Message>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)132133Iterate over each `message` from the parent process.134135This requires the [`ipc`](#optionsipc) option to be `true`. The [type](ipc.md#message-type) of `message` depends on the [`serialization`](#optionsserialization) option.136137[More info.](ipc.md#listening-to-messages)138Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 139why, one step back139## Return valueMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 140why, one step back140Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
lines 141–142why, one step back141_TypeScript:_ [`ResultPromise`](typescript.md)\142_Type:_ `Promise<object> | Subprocess`Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 143why, one step back143Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 144why, one step back144The return value of all [asynchronous methods](#methods) is both:Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
lines 145–146why, one step back145- the [subprocess](#subprocess).146- 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 147–149why, one step back147148[More info.](execution.md#subprocess)149Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
lines 150–151why, one step back150## Subprocess151Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 152why, one step back152_TypeScript:_ [`Subprocess`](typescript.md)Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
lines 153–155why, one step back153154[`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with the following methods and properties.155Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 156–198why, one step back156### subprocess\[Symbol.asyncIterator\]()157158_Returns_: [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)159160Subprocesses are [async iterables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator). They iterate over each output line.161162[More info.](lines.md#progressive-splitting)163164### subprocess.iterable(readableOptions?)165166`readableOptions`: [`ReadableOptions`](#readableoptions)\167_Returns_: [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)168169Same as [`subprocess[Symbol.asyncIterator]`](#subprocesssymbolasynciterator) except [options](#readableoptions) can be provided.170171[More info.](lines.md#progressive-splitting)172173### subprocess.pipe(file, arguments?, options?)174175`file`: `string | URL`\176`arguments`: `string[]`\177`options`: [`Options`](#options) and [`PipeOptions`](#pipeoptions)\178_Returns_: [`Promise<Result>`](#result)179180[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.181182This 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.183184[More info.](pipe.md#array-syntax)185186### subprocess.pipe\`command\`187### subprocess.pipe(options)\`command\`188189`command`: `string`\190`options`: [`Options`](#options) and [`PipeOptions`](#pipeoptions)\191_Returns_: [`Promise<Result>`](#result)192193Like [`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).194195[More info.](pipe.md#template-string-syntax)196197### subprocess.pipe(secondSubprocess, pipeOptions?)198Rename some types (#1009)ehmickybefore adoption2ef9186
line 199why, one step back199`secondSubprocess`: [`ResultPromise`](#return-value)\Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 200–202why, one step back200`pipeOptions`: [`PipeOptions`](#pipeoptions)\201_Returns_: [`Promise<Result>`](#result)202Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 203why, one step back203Like [`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 204–208why, one step back204205[More info.](pipe.md#advanced-syntax)206207#### pipeOptions208Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 209why, one step back209_Type:_ `object`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 210–212why, one step back210211#### pipeOptions.from212Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 213–214why, one step back213_Type:_ `"stdout" | "stderr" | "all" | "fd3" | "fd4" | ...`\214_Default:_ `"stdout"`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 215–223why, one step back215216Which stream to pipe from the source subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.217218`"all"` pipes both [`stdout`](#subprocessstdout) and [`stderr`](#subprocessstderr). This requires the [`all`](#optionsall) option to be `true`.219220[More info.](pipe.md#source-file-descriptor)221222#### pipeOptions.to223Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 224–225why, one step back224_Type:_ `"stdin" | "fd3" | "fd4" | ...`\225_Default:_ `"stdin"`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 226–232why, one step back226227Which [stream](#subprocessstdin) to pipe to the destination subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.228229[More info.](pipe.md#destination-file-descriptor)230231#### pipeOptions.unpipeSignal232Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 233why, one step back233_Type:_ [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 234–245why, one step back234235Unpipe the subprocess when the signal aborts.236237[More info.](pipe.md#unpipe)238239### subprocess.kill(signal, error?)240### subprocess.kill(error?)241242`signal`: `string | number`\243`error`: `Error`\244_Returns_: `boolean`245Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 246why, one step back246Sends 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 247–255why, one step back247248This returns `false` when the signal could not be sent, for example when the subprocess has already exited.249250When 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).251252[More info.](termination.md)253254### subprocess.pid255Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 256why, one step back256_Type:_ `number | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 257–263why, one step back257258Process identifier ([PID](https://en.wikipedia.org/wiki/Process_identifier)).259260This is `undefined` if the subprocess failed to spawn.261262[More info.](termination.md#inter-process-termination)263Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 264why, one step back264### subprocess.sendMessage(message)Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 265why, one step back265Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 266–267why, one step back266`message`: [`Message`](ipc.md#message-type)\267_Returns_: `Promise<void>`Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 268why, one step back268Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 269why, one step back269Send a `message` to the subprocess.Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 270why, one step back270Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 271why, one step back271This 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 272–274why, one step back272273[More info.](ipc.md#exchanging-messages)274Add `filter` option to `getOneMessage()` (#1076)ehmickybefore adoption571e052
line 275why, one step back275### subprocess.getOneMessage(getOneMessageOptions?)Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 276why, one step back276Add `filter` option to `getOneMessage()` (#1076)ehmickybefore adoption571e052
line 277why, one step back277_getOneMessageOptions_: [`GetOneMessageOptions`](#getonemessageoptions)\Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 278why, one step back278_Returns_: [`Promise<Message>`](ipc.md#message-type)Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 279why, one step back279Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 280why, one step back280Receive a single `message` from the subprocess.Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 281why, one step back281Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 282why, one step back282This 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 283–285why, one step back283284[More info.](ipc.md#exchanging-messages)285Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 286–295why, one step back286### subprocess.getEachMessage()287288_Returns_: [`AsyncIterable<Message>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)289290Iterate over each `message` from the subprocess.291292This requires the [`ipc`](#optionsipc) option to be `true`. The [type](ipc.md#message-type) of `message` depends on the [`serialization`](#optionsserialization) option.293294[More info.](ipc.md#listening-to-messages)295Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 296–297why, one step back296### subprocess.stdin297Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 298why, one step back298_Type:_ [`Writable | null`](https://nodejs.org/api/stream.html#class-streamwritable)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 299–307why, one step back299300The subprocess [`stdin`](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)) as a stream.301302This 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).303304[More info.](streams.md#manual-streaming)305306### subprocess.stdout307Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 308why, one step back308_Type:_ [`Readable | null`](https://nodejs.org/api/stream.html#class-streamreadable)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 309–317why, one step back309310The subprocess [`stdout`](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)) as a stream.311312This 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`.313314[More info.](streams.md#manual-streaming)315316### subprocess.stderr317Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 318why, one step back318_Type:_ [`Readable | null`](https://nodejs.org/api/stream.html#class-streamreadable)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 319–327why, one step back319320The subprocess [`stderr`](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)) as a stream.321322This 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`.323324[More info.](streams.md#manual-streaming)325326### subprocess.all327Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 328why, one step back328_Type:_ [`Readable | undefined`](https://nodejs.org/api/stream.html#class-streamreadable)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 329–339why, one step back329330Stream combining/interleaving [`subprocess.stdout`](#subprocessstdout) and [`subprocess.stderr`](#subprocessstderr).331332This requires the [`all`](#optionsall) option to be `true`.333334This 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`.335336More info on [interleaving](output.md#interleaved-output) and [streaming](streams.md#manual-streaming).337338### subprocess.stdio339Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 340why, one step back340_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 341–358why, one step back341342The subprocess [`stdin`](#subprocessstdin), [`stdout`](#subprocessstdout), [`stderr`](#subprocessstderr) and [other files descriptors](#optionsstdio) as an array of streams.343344Each 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`.345346[More info.](streams.md#manual-streaming)347348### subprocess.readable(readableOptions?)349350`readableOptions`: [`ReadableOptions`](#readableoptions)\351_Returns_: [`Readable`](https://nodejs.org/api/stream.html#class-streamreadable) Node.js stream352353Converts the subprocess to a readable stream.354355[More info.](streams.md#converting-a-subprocess-to-a-stream)356357#### readableOptions358Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 359why, one step back359_Type:_ `object`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 360–362why, one step back360361#### readableOptions.from362Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 363–364why, one step back363_Type:_ `"stdout" | "stderr" | "all" | "fd3" | "fd4" | ...`\364_Default:_ `"stdout"`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 365–373why, one step back365366Which stream to read from the subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.367368`"all"` reads both [`stdout`](#subprocessstdout) and [`stderr`](#subprocessstderr). This requires the [`all`](#optionsall) option to be `true`.369370[More info.](streams.md#different-file-descriptor)371372#### readableOptions.binary373Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 374–375why, one step back374_Type:_ `boolean`\375_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 376–386why, one step back376377If `false`, iterates over lines. Each line is a string.378379If `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)).380381This is always `true` when the [`encoding`](#optionsencoding) option is binary.382383More info for [iterables](binary.md#iterable) and [streams](binary.md#streams).384385#### readableOptions.preserveNewlines386Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 387–388why, one step back387_Type:_ `boolean`\388_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 389–404why, one step back389390If both this option and the [`binary`](#readableoptionsbinary) option is `false`, [newlines](https://en.wikipedia.org/wiki/Newline) are stripped from each line.391392[More info.](lines.md#iterable)393394### subprocess.writable(writableOptions?)395396`writableOptions`: [`WritableOptions`](#writableoptions)\397_Returns_: [`Writable`](https://nodejs.org/api/stream.html#class-streamwritable) Node.js stream398399Converts the subprocess to a writable stream.400401[More info.](streams.md#converting-a-subprocess-to-a-stream)402403#### writableOptions404Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 405why, one step back405_Type:_ `object`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 406–408why, one step back406407#### writableOptions.to408Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 409–410why, one step back409_Type:_ `"stdin" | "fd3" | "fd4" | ...`\410_Default:_ `"stdin"`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 411–426why, one step back411412Which [stream](#subprocessstdin) to write to the subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.413414[More info.](streams.md#different-file-descriptor)415416### subprocess.duplex(duplexOptions?)417418`duplexOptions`: [`ReadableOptions | WritableOptions`](#readableoptions)\419_Returns_: [`Duplex`](https://nodejs.org/api/stream.html#class-streamduplex) Node.js stream420421Converts the subprocess to a duplex stream.422423[More info.](streams.md#converting-a-subprocess-to-a-stream)424425## Result426Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 427why, one step back427_TypeScript:_ [`Result`](typescript.md) or [`SyncResult`](typescript.md\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 428why, one step back428_Type:_ `object`Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 429why, one step back429Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 430why, one step back430[Result](execution.md#result) of a subprocess successful execution.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 431–435why, one step back431432When the subprocess [fails](errors.md#subprocess-failure), it is rejected with an [`ExecaError`](#execaerror) instead.433434### result.stdout435Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 436why, one step back436_Type:_ `string | Uint8Array | string[] | Uint8Array[] | unknown[] | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 437–447why, one step back437438The output of the subprocess on [`stdout`](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)).439440This 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`.441442This 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).443444[More info.](output.md#stdout-and-stderr)445446### result.stderr447Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 448why, one step back448_Type:_ `string | Uint8Array | string[] | Uint8Array[] | unknown[] | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 449–459why, one step back449450The output of the subprocess on [`stderr`](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)).451452This 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`.453454This 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).455456[More info.](output.md#stdout-and-stderr)457458### result.all459Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 460why, one step back460_Type:_ `string | Uint8Array | string[] | Uint8Array[] | unknown[] | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 461–473why, one step back461462The output of the subprocess with [`result.stdout`](#resultstdout) and [`result.stderr`](#resultstderr) interleaved.463464This requires the [`all`](#optionsall) option to be `true`.465466This 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`.467468This 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).469470[More info.](output.md#interleaved-output)471472### result.stdio473Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 474why, one step back474_Type:_ `Array<string | Uint8Array | string[] | Uint8Array[] | unknown[] | undefined>`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 475–483why, one step back475476The output of the subprocess on [`stdin`](#optionsstdin), [`stdout`](#optionsstdout), [`stderr`](#optionsstderr) and [other file descriptors](#optionsstdio).477478Items 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`.479480Items are arrays when their corresponding `stdio` option is a [transform in object mode](transform.md#object-mode).481482[More info.](output.md#additional-file-descriptors)483Rename `result.ipc` to `result.ipcOutput` (#1075)ehmickybefore adoptionae9b360
line 484why, one step back484### result.ipcOutputAdd `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de
line 485why, one step back485Fix type of `result.ipc` (#1071)ehmickybefore adoption69152ec
line 486why, one step back486_Type_: [`Message[]`](ipc.md#message-type)Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de
lines 487–493why, one step back487488All the messages [sent by the subprocess](#sendmessagemessage) to the current process.489490This is empty unless the [`ipc`](#optionsipc) option is `true`. Also, this is empty if the [`buffer`](#optionsbuffer) option is `false`.491492[More info.](ipc.md#retrieve-all-messages)493Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 494–495why, one step back494### result.pipedFrom495Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 496why, one step back496_Type:_ [`Array<Result | ExecaError>`](#result)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 497–505why, one step back497498[Results](#result) of the other subprocesses that were piped into this subprocess.499500This array is initially empty and is populated each time the [`subprocess.pipe()`](#subprocesspipefile-arguments-options) method resolves.501502[More info.](pipe.md#result)503504### result.command505Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 506why, one step back506_Type:_ `string`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 507–513why, one step back507508The file and [arguments](input.md#command-arguments) that were run.509510[More info.](debugging.md#command)511512### result.escapedCommand513Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 514why, one step back514_Type:_ `string`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 515–521why, one step back515516Same as [`command`](#resultcommand) but escaped.517518[More info.](debugging.md#command)519520### result.cwd521Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 522why, one step back522_Type:_ `string`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 523–529why, one step back523524The [current directory](#optionscwd) in which the command was run.525526[More info.](environment.md#current-directory)527528### result.durationMs529Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 530why, one step back530_Type:_ `number`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 531–537why, one step back531532Duration of the subprocess, in milliseconds.533534[More info.](debugging.md#duration)535536### result.failed537Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 538why, one step back538_Type:_ `boolean`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 539–541why, one step back539540Whether the subprocess failed to run.541Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 542–543why, one step back542When this is `true`, the result is an [`ExecaError`](#execaerror) instance with additional error-related properties.543Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 544–545why, one step back544[More info.](errors.md#subprocess-failure)545Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 546–547why, one step back546## ExecaError547## ExecaSyncErrorMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 548why, one step back548Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 549why, one step back549_Type:_ `Error`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 550–560why, one step back550551Result of a subprocess [failed execution](errors.md#subprocess-failure).552553This error is thrown as an exception. If the [`reject`](#optionsreject) option is false, it is returned instead.554555This has the same shape as [successful results](#result), with the following additional properties.556557[More info.](errors.md)558559### error.message560Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 561why, one step back561_Type:_ `string`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 562–568why, one step back562563Error message when the subprocess [failed](errors.md#subprocess-failure) to run.564565[More info.](errors.md#error-message)566567### error.shortMessage568Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 569why, one step back569_Type:_ `string`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 570–576why, one step back570571This is the same as [`error.message`](#errormessage) except it does not include the subprocess [output](output.md).572573[More info.](errors.md#error-message)574575### error.originalMessage576Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 577why, one step back577_Type:_ `string | undefined`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 578–584why, one step back578579Original error message. This is the same as [`error.message`](#errormessage) excluding the subprocess [output](output.md) and some additional information added by Execa.580581[More info.](errors.md#error-message)582583### error.cause584Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 585why, one step back585_Type:_ `unknown | undefined`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 586–594why, one step back586587Underlying error, if there is one. For example, this is set by [`subprocess.kill(error)`](#subprocesskillerror).588589This is usually an `Error` instance.590591[More info.](termination.md#error-message-and-stack-trace)592593### error.code594Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 595why, one step back595_Type:_ `string | undefined`Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
lines 596–600why, one step back596597Node.js-specific [error code](https://nodejs.org/api/errors.html#errorcode), when available.598599### error.timedOut600Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 601why, one step back601_Type:_ `boolean`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 602–606why, one step back602603Whether the subprocess timed out due to the [`timeout`](#optionstimeout) option.604605[More info.](termination.md#timeout)606Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 607why, one step back607### error.isCanceledMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 608why, one step back608Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 609why, one step back609_Type:_ `boolean`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 610–614why, one step back610611Whether the subprocess was canceled using the [`cancelSignal`](#optionscancelsignal) option.612613[More info.](termination.md#canceling)614Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 615why, one step back615### error.isMaxBufferMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 616why, one step back616Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 617why, one step back617_Type:_ `boolean`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 618–622why, one step back618619Whether the subprocess failed because its output was larger than the [`maxBuffer`](#optionsmaxbuffer) option.620621[More info.](output.md#big-output)622Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 623why, one step back623### error.isTerminatedMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 624why, one step back624Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 625why, one step back625_Type:_ `boolean`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 626–632why, one step back626627Whether the subprocess was terminated by a [signal](termination.md#signal-termination) (like [`SIGTERM`](termination.md#sigterm)) sent by either:628- The current process.629- [Another process](termination.md#inter-process-termination). This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).630631[More info.](termination.md#signal-name-and-description)632Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 633why, one step back633### error.exitCodeMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 634why, one step back634Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 635why, one step back635_Type:_ `number | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 636–638why, one step back636637The numeric [exit code](https://en.wikipedia.org/wiki/Exit_status) of the subprocess that was run.638Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 639why, one step back639This 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 640–642why, one step back640641[More info.](errors.md#exit-code)642Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 643why, one step back643### error.signalMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 644why, one step back644Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 645why, one step back645_Type:_ `string | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 646–654why, one step back646647The name of the [signal](termination.md#signal-termination) (like [`SIGTERM`](termination.md#sigterm)) that terminated the subprocess, sent by either:648- The current process.649- [Another process](termination.md#inter-process-termination). This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).650651If a signal terminated the subprocess, this property is defined and included in the [error message](#errormessage). Otherwise it is `undefined`.652653[More info.](termination.md#signal-name-and-description)654Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 655why, one step back655### error.signalDescriptionMove API reference to its own page (#996)ehmickybefore adoption7cde496
line 656why, one step back656Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 657why, one step back657_Type:_ `string | undefined`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 658–666why, one step back658659A human-friendly description of the [signal](termination.md#signal-termination) that was used to terminate the subprocess.660661If 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.662663[More info.](termination.md#signal-name-and-description)664665## Options666Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 667why, one step back667_TypeScript:_ [`Options`](typescript.md) or [`SyncOptions`](typescript.md\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 668why, one step back668_Type:_ `object`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 669–675why, one step back669670This lists all options for [`execa()`](#execafile-arguments-options) and the [other methods](#methods).671672The 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).673674### options.preferLocal675Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 676–677why, one step back676_Type:_ `boolean`\677_Default:_ `true` with [`$`](#file-arguments-options), `false` otherwiseMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 678–684why, one step back678679Prefer locally installed binaries when looking for a binary to execute.680681[More info.](environment.md#local-binaries)682683### options.localDir684Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 685–686why, one step back685_Type:_ `string | URL`\686_Default:_ [`cwd`](#optionscwd) optionMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 687–693why, one step back687688Preferred path to find locally installed binaries, when using the [`preferLocal`](#optionspreferlocal) option.689690[More info.](environment.md#local-binaries)691692### options.node693Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 694–695why, one step back694_Type:_ `boolean`\695_Default:_ `true` with [`execaNode()`](#execanodescriptpath-arguments-options), `false` otherwiseMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 696–698why, one step back696697If `true`, runs with Node.js. The first argument must be a Node.js file.698Improve the documentation of the `node`/`nodePath`/`nodeOptions` options (#1011)ehmickybefore adoption4878db5
lines 699–700why, one step back699The 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.700Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 701–704why, one step back701[More info.](node.md)702703### options.nodeOptions704Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 705why, one step back705_Type:_ `string[]`\Improve the documentation of the `node`/`nodePath`/`nodeOptions` options (#1011)ehmickybefore adoption4878db5
line 706why, one step back706_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 707–715why, one step back707708List of [CLI flags](https://nodejs.org/api/cli.html#cli_options) passed to the [Node.js executable](#optionsnodepath).709710Requires the [`node`](#optionsnode) option to be `true`.711712[More info.](node.md#nodejs-cli-flags)713714### options.nodePath715Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 716–717why, one step back716_Type:_ `string | URL`\717_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 718–726why, one step back718719Path to the Node.js executable.720721Requires the [`node`](#optionsnode) option to be `true`.722723[More info.](node.md#nodejs-version)724725### options.shell726Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 727–728why, one step back727_Type:_ `boolean | string | URL`\728_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 729–739why, one step back729730If `true`, runs the command inside of a [shell](https://en.wikipedia.org/wiki/Shell_(computing)).731732Uses [`/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.733734We [recommend against](shell.md#avoiding-shells) using this option.735736[More info.](shell.md)737738### options.cwd739Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 740–741why, one step back740_Type:_ `string | URL`\741_Default:_ `process.cwd()`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 742–750why, one step back742743Current [working directory](https://en.wikipedia.org/wiki/Working_directory) of the subprocess.744745This is also used to resolve the [`nodePath`](#optionsnodepath) option when it is a relative path.746747[More info.](environment.md#current-directory)748749### options.env750Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 751–752why, one step back751_Type:_ `object`\752_Default:_ [`process.env`](https://nodejs.org/api/process.html#processenv)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 753–761why, one step back753754[Environment variables](https://en.wikipedia.org/wiki/Environment_variable).755756Unless the [`extendEnv`](#optionsextendenv) option is `false`, the subprocess also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).757758[More info.](input.md#environment-variables)759760### options.extendEnv761Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 762–763why, one step back762_Type:_ `boolean`\763_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 764–771why, one step back764765If `true`, the subprocess uses both the [`env`](#optionsenv) option and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).766If `false`, only the `env` option is used, not `process.env`.767768[More info.](input.md#environment-variables)769770### options.input771Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 772why, one step back772_Type:_ `string | Uint8Array | stream.Readable`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 773–781why, one step back773774Write some input to the subprocess' [`stdin`](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)).775776See also the [`inputFile`](#optionsinputfile) and [`stdin`](#optionsstdin) options.777778[More info.](input.md#string-input)779780### options.inputFile781Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 782why, one step back782_Type:_ `string | URL`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 783–791why, one step back783784Use a file as input to the subprocess' [`stdin`](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)).785786See also the [`input`](#optionsinput) and [`stdin`](#optionsstdin) options.787788[More info.](input.md#file-input)789790### options.stdin791Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 792why, one step back792_TypeScript:_ [`StdinOption`](typescript.md) or [`StdinSyncOption`](typescript.md)\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 793–794why, one step back793_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)\794_Default:_ `'inherit'` with [`$`](#file-arguments-options), `'pipe'` otherwiseMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 795–803why, one step back795796How 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).797798This can be an [array of values](output.md#multiple-targets) such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.799800More info on [available values](input.md), [streaming](streams.md) and [transforms](transform.md).801802### options.stdout803Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 804why, one step back804_TypeScript:_ [`StdoutStderrOption`](typescript.md) or [`StdoutStderrSyncOption`](typescript.md)\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 805–806why, one step back805_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)\806_Default:_ `pipe`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 807–815why, one step back807808How 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).809810This can be an [array of values](output.md#multiple-targets) such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.811812More info on [available values](output.md), [streaming](streams.md) and [transforms](transform.md).813814### options.stderr815Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 816why, one step back816_TypeScript:_ [`StdoutStderrOption`](typescript.md) or [`StdoutStderrSyncOption`](typescript.md)\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 817–818why, one step back817_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)\818_Default:_ `pipe`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 819–827why, one step back819820How 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).821822This can be an [array of values](output.md#multiple-targets) such as `['inherit', 'pipe']` or `[fileUrl, 'pipe']`.823824More info on [available values](output.md), [streaming](streams.md) and [transforms](transform.md).825826### options.stdio827Add documentation about TypeScript types (#1015)ehmickybefore adoptionf79e058
line 828why, one step back828_TypeScript:_ [`Options['stdio']`](typescript.md) or [`SyncOptions['stdio']`](typescript.md)\Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 829–830why, one step back829_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)\830_Default:_ `pipe`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 831–841why, one step back831832Like 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'}`.833834A single string can be used [as a shortcut](output.md#shortcut).835836The array can have more than 3 items, to create [additional file descriptors](output.md#additional-file-descriptors) beyond [`stdin`](#optionsstdin)/[`stdout`](#optionsstdout)/[`stderr`](#optionsstderr).837838More info on [available values](output.md), [streaming](streams.md) and [transforms](transform.md).839840### options.all841Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 842–843why, one step back842_Type:_ `boolean`\843_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 844–850why, one step back844845Add a [`subprocess.all`](#subprocessall) stream and a [`result.all`](#resultall) property.846847[More info.](output.md#interleaved-output)848849### options.encoding850Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 851–852why, one step back851_Type:_ `'utf8' | 'utf16le' | 'buffer' | 'hex' | 'base64' | 'base64url' | 'latin1' | 'ascii'`\852_Default:_ `'utf8'`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 853–865why, one step back853854If 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).855856If it outputs binary data instead, this should be either:857- `'buffer'`: returns the binary output as an [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array).858- [`'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.859860The output is available with [`result.stdout`](#resultstdout), [`result.stderr`](#resultstderr) and [`result.stdio`](#resultstdio).861862[More info.](binary.md)863864### options.lines865Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 866–867why, one step back866_Type:_ `boolean`\867_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 868–878why, one step back868869Set [`result.stdout`](#resultstdout), [`result.stderr`](#resultstdout), [`result.all`](#resultall) and [`result.stdio`](#resultstdio) as arrays of strings, splitting the subprocess' output into lines.870871This cannot be used if the [`encoding`](#optionsencoding) option is [binary](binary.md#binary-output).872873By default, this applies to both `stdout` and `stderr`, but [different values can also be passed](output.md#stdoutstderr-specific-options).874875[More info.](lines.md#simple-splitting)876877### options.stripFinalNewline878Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 879–880why, one step back879_Type:_ `boolean`\880_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 881–891why, one step back881882Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from the output.883884If the [`lines`](#optionslines) option is true, this applies to each output line instead.885886By default, this applies to both `stdout` and `stderr`, but [different values can also be passed](output.md#stdoutstderr-specific-options).887888[More info.](lines.md#newlines)889890### options.maxBuffer891Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 892–893why, one step back892_Type:_ `number`\893_Default:_ `100_000_000`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 894–902why, one step back894895Largest amount of data allowed on [`stdout`](#resultstdout), [`stderr`](#resultstderr) and [`stdio`](#resultstdio).896897By default, this applies to both `stdout` and `stderr`, but [different values can also be passed](output.md#stdoutstderr-specific-options).898899[More info.](output.md#big-output)900901### options.buffer902Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 903–904why, one step back903_Type:_ `boolean`\904_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 905–913why, one step back905906When `buffer` is `false`, the [`result.stdout`](#resultstdout), [`result.stderr`](#resultstderr), [`result.all`](#resultall) and [`result.stdio`](#resultstdio) properties are not set.907908By default, this applies to both `stdout` and `stderr`, but [different values can also be passed](output.md#stdoutstderr-specific-options).909910[More info.](output.md#low-memory)911912### options.ipc913Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 914why, one step back914_Type:_ `boolean`\Add `ipcInput` option (#1068)ehmickybefore adoption46cae30
line 915why, one step back915_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 916why, one step back916Debounce `message` events (#1087)ehmickybefore adoptione8bab97
line 917why, one step back917Enables exchanging messages with the subprocess using [`subprocess.sendMessage(message)`](#subprocesssendmessagemessage), [`subprocess.getOneMessage()`](#subprocessgetonemessagegetonemessageoptions) and [`subprocess.getEachMessage()`](#subprocessgeteachmessage).Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 918why, one step back918Add `ipcInput` option (#1068)ehmickybefore adoption46cae30
lines 919–920why, one step back919The subprocess must be a Node.js file.920Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 921–924why, one step back921[More info.](ipc.md)922923### options.serialization924Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 925–926why, one step back925_Type:_ `'json' | 'advanced'`\926_Default:_ `'advanced'`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 927–930why, one step back927928Specify the kind of serialization used for sending messages between subprocesses when using the [`ipc`](#optionsipc) option.929930[More info.](ipc.md#message-type)Add `ipcInput` option (#1068)ehmickybefore adoption46cae30
lines 931–940why, one step back931932### options.ipcInput933934_Type_: [`Message`](ipc.md#message-type)935936Sends an IPC message when the subprocess starts.937938The subprocess must be a [Node.js file](#optionsnode). The value's [type](ipc.md#message-type) depends on the [`serialization`](#optionsserialization) option.939940More 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 941–943why, one step back941942### options.verbose943Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 944–945why, one step back944_Type:_ `'none' | 'short' | 'full'`\945_Default:_ `'none'`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 946–948why, one step back946947If `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.948Log IPC messages with `verbose: 'full'` (#1063)ehmickybefore adoption839c2fe
line 949why, one step back949If `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 950–956why, one step back950951By default, this applies to both `stdout` and `stderr`, but [different values can also be passed](output.md#stdoutstderr-specific-options).952953[More info.](debugging.md#verbose-mode)954955### options.reject956Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 957–958why, one step back957_Type:_ `boolean`\958_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
line 959why, one step back959Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 960why, one step back960Setting 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 961–965why, one step back961962[More info.](errors.md#preventing-exceptions)963964### options.timeout965Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 966–967why, one step back966_Type:_ `number`\967_Default:_ `0`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 968–970why, one step back968969If `timeout` is greater than `0`, the subprocess will be [terminated](#optionskillsignal) if it runs for longer than that amount of milliseconds.970Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 971why, one step back971On timeout, [`result.timedOut`](#errortimedout) becomes `true`.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 972–976why, one step back972973[More info.](termination.md#timeout)974975### options.cancelSignal976Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 977why, one step back977_Type:_ [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 978–980why, one step back978979You can abort the subprocess using [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).980Improve documentation of `error.*` fields (#1006)ehmickybefore adoption4ee0dec
line 981why, one step back981When `AbortController.abort()` is called, [`result.isCanceled`](#erroriscanceled) becomes `true`.Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 982–986why, one step back982983[More info.](termination.md#canceling)984985### options.forceKillAfterDelay986Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 987–988why, one step back987_Type:_ `number | false`\988_Default:_ `5000`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 989–995why, one step back989990If the subprocess is terminated but does not exit, forcefully exit it by sending [`SIGKILL`](https://en.wikipedia.org/wiki/Signal_(IPC)#SIGKILL).991992[More info.](termination.md#forceful-termination)993994### options.killSignal995Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 996–997why, one step back996_Type:_ `string | number`\997_Default:_ `'SIGTERM'`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 998–1006why, one step back998999Default [signal](https://en.wikipedia.org/wiki/Signal_(IPC)) used to terminate the subprocess.10001001This can be either a name (like [`'SIGTERM'`](termination.md#sigterm)) or a number (like `9`).10021003[More info.](termination.md#default-signal)10041005### options.detached1006Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1007–1008why, one step back1007_Type:_ `boolean`\1008_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1009–1015why, one step back10091010Run the subprocess independently from the current process.10111012[More info.](environment.md#background-subprocess)10131014### options.cleanup1015Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1016–1017why, one step back1016_Type:_ `boolean`\1017_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1018–1024why, one step back10181019Kill the subprocess when the current process exits.10201021[More info.](termination.md#current-process-exit)10221023### options.uid1024Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1025–1026why, one step back1025_Type:_ `number`\1026_Default:_ current user identifierMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1027–1033why, one step back10271028Sets the [user identifier](https://en.wikipedia.org/wiki/User_identifier) of the subprocess.10291030[More info.](windows.md#uid-and-gid)10311032### options.gid1033Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1034–1035why, one step back1034_Type:_ `number`\1035_Default:_ current group identifierMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1036–1042why, one step back10361037Sets the [group identifier](https://en.wikipedia.org/wiki/Group_identifier) of the subprocess.10381039[More info.](windows.md#uid-and-gid)10401041### options.argv01042Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1043–1044why, one step back1043_Type:_ `string`\1044_Default:_ file being executedMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1045–1049why, one step back10451046Value of [`argv[0]`](https://nodejs.org/api/process.html#processargv0) sent to the subprocess.10471048### options.windowsHide1049Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1050–1051why, one step back1050_Type:_ `boolean`\1051_Default:_ `true`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1052–1058why, one step back10521053On Windows, do not create a new console window.10541055[More info.](windows.md#console-window)10561057### options.windowsVerbatimArguments1058Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1059–1060why, one step back1059_Type:_ `boolean`\1060_Default:_ `true` if the [`shell`](#optionsshell) option is `true`, `false` otherwiseMove API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1061–1075why, one step back10611062If `false`, escapes the command arguments on Windows.10631064[More info.](windows.md#cmdexe-escaping)10651066## Transform options10671068A transform or an [array of transforms](transform.md#combining) can be passed to the [`stdin`](#optionsstdin), [`stdout`](#optionsstdout), [`stderr`](#optionsstderr) or [`stdio`](#optionsstdio) option.10691070A transform is either a [generator function](#transformoptionstransform) or a plain object with the following members.10711072[More info.](transform.md)10731074### transformOptions.transform1075Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 1076why, one step back1076_Type:_ `GeneratorFunction<string | Uint8Array | unknown>` | `AsyncGeneratorFunction<string | Uint8Array | unknown>`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1077–1083why, one step back10771078Map or [filter](transform.md#filtering) the [input](input.md) or [output](output.md) of the subprocess.10791080More info [here](transform.md#summary) and [there](transform.md#sharing-state).10811082### transformOptions.final1083Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
line 1084why, one step back1084_Type:_ `GeneratorFunction<string | Uint8Array | unknown>` | `AsyncGeneratorFunction<string | Uint8Array | unknown>`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1085–1091why, one step back10851086Create additional lines after the last one.10871088[More info.](transform.md#finalizing)10891090### transformOptions.binary1091Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1092–1093why, one step back1092_Type:_ `boolean`\1093_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1094–1100why, one step back10941095If `true`, iterate over arbitrary chunks of `Uint8Array`s instead of line `string`s.10961097[More info.](binary.md#transforms)10981099### transformOptions.preserveNewlines1100Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1101–1102why, one step back1101_Type:_ `boolean`\1102_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1103–1109why, one step back11031104If `true`, keep newlines in each `line` argument. Also, this allows multiple `yield`s to produces a single line.11051106[More info.](lines.md#transforms)11071108### transformOptions.objectMode1109Fix style inconsistency in API reference (#1010)ehmickybefore adoption42bea7f
lines 1110–1111why, one step back1110_Type:_ `boolean`\1111_Default:_ `false`Move API reference to its own page (#996)ehmickybefore adoption7cde496
lines 1112–1120why, one step back11121113If `true`, allow [`transformOptions.transform`](#transformoptionstransform) and [`transformOptions.final`](#transformoptionsfinal) to return any type, not just `string` or `Uint8Array`.11141115[More info.](transform.md#object-mode)11161117<hr>11181119[**Previous**: 🔍 Differences with Bash and zx](bash.md)\1120[**Top**: Table of contents](../readme.md#documentation)