Skip to content

Latest commit

 

History

History
264 lines (147 loc) · 3.7 KB

Command.md

File metadata and controls

264 lines (147 loc) · 3.7 KB

Class: Command

Implements

  • CommandInfo

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Command(«destructured», spawnOpts, spawn, killProcess)

Parameters

Name Type
«destructured» CommandInfo & { index: number }
spawnOpts SpawnOptions
spawn SpawnCommand
killProcess KillProcess

Properties

close

Readonly close: Subject<CloseEvent>


command

Readonly command: string

Inherit Doc

Implementation of

CommandInfo.command


cwd

Optional Readonly cwd: string

Inherit Doc

Implementation of

CommandInfo.cwd


env

Readonly env: Record<string, unknown>

Inherit Doc

Implementation of

CommandInfo.env


error

Readonly error: Subject<unknown>


exited

exited: boolean = false


index

Readonly index: number


killProcess

Private Readonly killProcess: KillProcess


killed

killed: boolean = false


name

Readonly name: string

Inherit Doc

Implementation of

CommandInfo.name


pid

Optional pid: number


prefixColor

Optional Readonly prefixColor: string

Inherit Doc

Implementation of

CommandInfo.prefixColor


process

Optional process: ChildProcess


spawn

Private Readonly spawn: SpawnCommand


spawnOpts

Private Readonly spawnOpts: SpawnOptions


stderr

Readonly stderr: Subject<Buffer>


stdin

Optional stdin: Writable


stdout

Readonly stdout: Subject<Buffer>


timer

Readonly timer: Subject<TimerEvent>

Accessors

killable

get killable(): boolean

Returns

boolean

Deprecated

Methods

kill

kill(code?): void

Kills this command, optionally specifying a signal to send to it.

Parameters

Name Type
code? string

Returns

void


start

start(): void

Starts this command, piping output, error and close events onto the corresponding observables.

Returns

void


canKill

Static canKill(command): command is Command & Object

Detects whether a command can be killed.

Also works as a type guard on the input command.

Parameters

Name Type
command Command

Returns

command is Command & Object