Skip to main content
spawnSync - child_process - Node documentation
function spawnSync

Usage in Deno

import { spawnSync } from "node:child_process";
spawnSync(command: string): SpawnSyncReturns<Buffer>

The child_process.spawnSync() method is generally identical to spawn with the exception that the function will not return until the child process has fully closed. When a timeout has been encountered and killSignal is sent, the method won't return until the process has completely exited. If the process intercepts and handles the SIGTERM signal and doesn't exit, the parent process will wait until the child process has exited.

If the shell option is enabled, do not pass unsanitized user input to this function. Any input containing shell metacharacters may be used to trigger arbitrary command execution.

Parameters

command: string

The command to run.

Return Type

spawnSync(
command: string,
): SpawnSyncReturns<string>

Parameters

command: string

Return Type

spawnSync(
command: string,
): SpawnSyncReturns<Buffer>

Parameters

command: string

Return Type

spawnSync(
command: string,
options?: SpawnSyncOptions,
): SpawnSyncReturns<string | Buffer>

Parameters

command: string
optional
options: SpawnSyncOptions

Return Type

SpawnSyncReturns<string | Buffer>
spawnSync(
command: string,
args: readonly string[],
): SpawnSyncReturns<Buffer>

Parameters

command: string
args: readonly string[]

Return Type

spawnSync(
command: string,
args: readonly string[],
): SpawnSyncReturns<string>

Parameters

command: string
args: readonly string[]

Return Type

spawnSync(
command: string,
args: readonly string[],
): SpawnSyncReturns<Buffer>

Parameters

command: string
args: readonly string[]

Return Type

spawnSync(
command: string,
args?: readonly string[],
options?: SpawnSyncOptions,
): SpawnSyncReturns<string | Buffer>

Parameters

command: string
optional
args: readonly string[]
optional
options: SpawnSyncOptions

Return Type

SpawnSyncReturns<string | Buffer>
Back to top