FspawnSync
Bun

function

child_process.spawnSync

function spawnSync(
command: string
): SpawnSyncReturns<NonSharedBuffer>;

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.

@param command

The command to run.

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

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.

@param command

The command to run.

function spawnSync(
command: string,
): SpawnSyncReturns<NonSharedBuffer>;

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.

@param command

The command to run.

function spawnSync(
command: string,
): SpawnSyncReturns<string | NonSharedBuffer>;

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.

@param command

The command to run.

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

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.

@param command

The command to run.

@param args

List of string arguments.

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

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.

@param command

The command to run.

@param args

List of string arguments.

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

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.

@param command

The command to run.

@param args

List of string arguments.

function spawnSync(
command: string,
args?: readonly string[],
): SpawnSyncReturns<string | NonSharedBuffer>;

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.

@param command

The command to run.

@param args

List of string arguments.

Referenced types

interface SpawnSyncReturns<T>

interface SpawnSyncOptionsWithStringEncoding

  • argv0?: string
  • cwd?: string | URL
  • encoding: BufferEncoding
  • env?: ProcessEnv
  • gid?: number
  • input?: string | ArrayBufferView<ArrayBufferLike>
  • killSignal?: number | Signals

    The signal value to be used when the spawned process will be killed by the abort signal.

  • maxBuffer?: number
  • serialization?: SerializationType

    Specify the kind of serialization used for sending messages between processes.

  • shell?: string | boolean
  • stdio?: StdioOptions

    Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information.

  • timeout?: number
  • uid?: number
  • windowsHide?: boolean

interface SpawnSyncOptionsWithBufferEncoding

  • argv0?: string
  • cwd?: string | URL
  • encoding?: null | 'buffer'
  • env?: ProcessEnv
  • gid?: number
  • input?: string | ArrayBufferView<ArrayBufferLike>
  • killSignal?: number | Signals

    The signal value to be used when the spawned process will be killed by the abort signal.

  • maxBuffer?: number
  • serialization?: SerializationType

    Specify the kind of serialization used for sending messages between processes.

  • shell?: string | boolean
  • stdio?: StdioOptions

    Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information.

  • timeout?: number
  • uid?: number
  • windowsHide?: boolean

interface SpawnSyncOptions

  • argv0?: string
  • cwd?: string | URL
  • encoding?: null | BufferEncoding | 'buffer'
  • env?: ProcessEnv
  • gid?: number
  • input?: string | ArrayBufferView<ArrayBufferLike>
  • killSignal?: number | Signals

    The signal value to be used when the spawned process will be killed by the abort signal.

  • maxBuffer?: number
  • serialization?: SerializationType

    Specify the kind of serialization used for sending messages between processes.

  • shell?: string | boolean
  • stdio?: StdioOptions

    Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information.

  • timeout?: number
  • uid?: number
  • windowsHide?: boolean