A collection of utilities related to executing a sub-process.

export

### Hierarchy

- ExecUtils

## Index

### Methods

- handleSpawnResult
- spawnAndGetOutput
- spawnWithInheritedStdio

## Methods

### Static Private handleSpawnResult

- handleSpawnResult<T>(result: SpawnSyncReturns<Buffer | string>, argv: string[]): T

- - Defined in @zowe/imperative/src/utilities/src/ExecUtils.ts:45

  #### Type parameters

  - #### T = Buffer | string

  #### Parameters

  - ##### result: SpawnSyncReturns<Buffer | string>

  - ##### argv: string[]

  #### Returns T

### Static spawnAndGetOutput

- spawnAndGetOutput(command: string, args?: string[], options?: SpawnSyncOptions): Buffer | string

- - Defined in @zowe/imperative/src/utilities/src/ExecUtils.ts:28

  Spawn a process with arguments and throw an error if the process fails. Parameters are same as `child_process.spawnSync` (see Node.js docs). Use this method if you want the safe argument parsing of `spawnSync` combined with the smart output handling of `execSync`.

  #### Parameters

  - ##### command: string

  - ##### Optional args: string[]

  - ##### Optional options: SpawnSyncOptions

  #### Returns Buffer | string

  Contents of stdout as buffer or string

### Static spawnWithInheritedStdio

- spawnWithInheritedStdio(command: string, args?: string[], options?: SpawnSyncOptions): void

- - Defined in @zowe/imperative/src/utilities/src/ExecUtils.ts:40

  Spawn a process with arguments and throw an error if the process fails. Parameters are same as `child_process.spawnSync` (see Node.js docs). Output is inherited by the parent process instead of being returned. Use this method if you want the safe argument parsing of `spawnSync` combined with the smart output handling of `execSync`.

  #### Parameters

  - ##### command: string

  - ##### Optional args: string[]

  - ##### Optional options: SpawnSyncOptions

  #### Returns void

Generated using TypeDoc