# Interface: ExecuteOptions ‹EncodingType

Extended options for module.execute and module.command

# Type parameters

EncodingType

# Hierarchy

  • Options‹EncodingType›

    ExecuteOptions

# Properties

# Optional Readonly all

all? : undefined | false | true

Inherited from ExecuteOptions.all

Defined in node_modules/execa/index.d.ts:96

Add an .all property on the promise and the resolved value. The property contains the output of the process with stdout and stderr interleaved.

default false


# Optional Readonly argv0

argv0? : undefined | string

Inherited from ExecuteOptions.argv0

Defined in node_modules/execa/index.d.ts:129

Explicitly set the value of argv[0] sent to the child process. This will be set to command or file if not specified.


# Optional Readonly buffer

buffer? : undefined | false | true

Inherited from ExecuteOptions.buffer

Defined in node_modules/execa/index.d.ts:61

Buffer the output from the spawned process. When set to false, you must read the output of stdout and stderr (or all if the all option is true). Otherwise the returned promise will not be resolved/rejected.

If the spawned process fails, error.stdout, error.stderr, and error.all will contain the buffered data.

default true


# Optional Readonly cleanup

cleanup? : undefined | false | true

Inherited from ExecuteOptions.cleanup

Defined in node_modules/execa/index.d.ts:23

Kill the spawned process when the parent process exits unless either:

  • the spawned process is detached
  • the parent process is terminated abruptly, for example, with SIGKILL as opposed to SIGTERM or a normal exit

default true


# Optional Readonly cwd

cwd? : undefined | string

Inherited from ExecuteOptions.cwd

Defined in node_modules/execa/index.d.ts:117

Current working directory of the child process.

default process.cwd()


# Optional Readonly detached

detached? : undefined | false | true

Inherited from ExecuteOptions.detached

Defined in node_modules/execa/index.d.ts:156

Prepare child to run independently of its parent process. Specific behavior depends on the platform.

default false


# Optional Readonly encoding

encoding? : EncodingType

Inherited from ExecuteOptions.encoding

Defined in node_modules/execa/index.d.ts:185

Specify the character encoding used to decode the stdout and stderr output. If set to null, then stdout and stderr will be a Buffer instead of a string.

default 'utf8'


# Optional Readonly env

env? : NodeJS.ProcessEnv

Inherited from ExecuteOptions.env

Defined in node_modules/execa/index.d.ts:124

Environment key-value pairs. Extends automatically from process.env. Set extendEnv to false if you don't want this.

default process.env


# Optional Readonly execPath

execPath? : undefined | string

Inherited from ExecuteOptions.execPath

Defined in node_modules/execa/index.d.ts:52

Path to the Node.js executable to use in child processes.

This can be either an absolute path or a path relative to the cwd option.

Requires preferLocal to be true.

For example, this can be used together with get-node to run a specific Node.js version in a child process.

default process.execPath


# Optional exitOnProcessFailure

exitOnProcessFailure? : undefined | false | true

Defined in src/util/types.ts:64

Exits using process.exit(errCode) if error is originated from shell. Otherwise throws as usual. Errors originated from node.js always throw.


# Optional Readonly extendEnv

extendEnv? : undefined | false | true

Inherited from ExecuteOptions.extendEnv

Defined in node_modules/execa/index.d.ts:110

Set to false if you don't want to extend the environment variables when providing the env property.

default true


# Optional Readonly gid

gid? : undefined | number

Inherited from ExecuteOptions.gid

Defined in node_modules/execa/index.d.ts:166

Sets the group identity of the process.


# Optional Readonly input

input? : string | Buffer | ReadableStream

Inherited from ExecuteOptions.input

Defined in node_modules/execa/index.d.ts:227

Write some input to the stdin of your binary.


# Optional Readonly killSignal

killSignal? : string | number

Inherited from ExecuteOptions.killSignal

Defined in node_modules/execa/index.d.ts:206

Signal value to be used when the spawned process will be killed.

default 'SIGTERM'


# Optional Readonly localDir

localDir? : undefined | string

Inherited from ExecuteOptions.localDir

Defined in node_modules/execa/index.d.ts:39

Preferred path to find locally installed binaries in (use with preferLocal).

default process.cwd()


# Optional Readonly maxBuffer

maxBuffer? : undefined | number

Inherited from ExecuteOptions.maxBuffer

Defined in node_modules/execa/index.d.ts:199

Largest amount of data in bytes allowed on stdout or stderr. Default: 100 MB.

default 100_000_000


# Optional Readonly preferLocal

preferLocal? : undefined | false | true

Inherited from ExecuteOptions.preferLocal

Defined in node_modules/execa/index.d.ts:32

Prefer locally installed binaries when looking for a binary to execute.

If you $ npm install foo, you can then execa('foo').

default false


# Optional Readonly reject

reject? : undefined | false | true

Inherited from ExecuteOptions.reject

Defined in node_modules/execa/index.d.ts:89

Setting this to false resolves the promise with the error instead of rejecting it.

default true


# Optional Readonly serialization

serialization? : "json" | "advanced"

Inherited from ExecuteOptions.serialization

Defined in node_modules/execa/index.d.ts:149

Specify the kind of serialization used for sending messages between processes when using the stdio: 'ipc' option or execa.node():

  • json: Uses JSON.stringify() and JSON.parse().
  • advanced: Uses v8.serialize()

Requires Node.js 13.2.0 or later.

More info.

default 'json'


# Optional Readonly shell

shell? : boolean | string

Inherited from ExecuteOptions.shell

Defined in node_modules/execa/index.d.ts:178

If true, runs command inside of a shell. Uses /bin/sh on UNIX and 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.

We recommend against using this option since it is:

  • not cross-platform, encouraging shell-specific syntax.
  • slower, because of the additional shell interpretation.
  • unsafe, potentially allowing command injection.

default false


# Optional Readonly stderr

stderr? : StdioOption

Inherited from ExecuteOptions.stderr

Defined in node_modules/execa/index.d.ts:82

Same options as stdio.

default 'pipe'


# Optional Readonly stdin

stdin? : StdioOption

Inherited from ExecuteOptions.stdin

Defined in node_modules/execa/index.d.ts:68

Same options as stdio.

default 'pipe'


# Optional stdio

stdio? : StdioOption

Overrides void

Defined in src/util/types.ts:66

The options.stdio option is used to configure the pipes that are established between the parent and child process.


# Optional Readonly stdout

stdout? : StdioOption

Inherited from ExecuteOptions.stdout

Defined in node_modules/execa/index.d.ts:75

Same options as stdio.

default 'pipe'


# Optional Readonly stripFinalNewline

stripFinalNewline? : undefined | false | true

Inherited from ExecuteOptions.stripFinalNewline

Defined in node_modules/execa/index.d.ts:103

Strip the final newline character from the output.

default true


# Optional Readonly timeout

timeout? : undefined | number

Inherited from ExecuteOptions.timeout

Defined in node_modules/execa/index.d.ts:192

If timeout is greater than 0, the parent will send the signal identified by the killSignal property (the default is SIGTERM) if the child runs longer than timeout milliseconds.

default 0


# Optional Readonly uid

uid? : undefined | number

Inherited from ExecuteOptions.uid

Defined in node_modules/execa/index.d.ts:161

Sets the user identity of the process.


# Optional Readonly windowsHide

windowsHide? : undefined | false | true

Inherited from ExecuteOptions.windowsHide

Defined in node_modules/execa/index.d.ts:220

On Windows, do not create a new console window. Please note this also prevents CTRL-C from working on Windows.

default true


# Optional Readonly windowsVerbatimArguments

windowsVerbatimArguments? : undefined | false | true

Inherited from ExecuteOptions.windowsVerbatimArguments

Defined in node_modules/execa/index.d.ts:213

If true, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to true automatically when the shell option is true.

default false