Skip to main content
Version: Next

Command

The command that create a child process.

Constructors

Constructor

new Command(execPath, options?): Command;

Parameters

ParameterType

execPath

string

options?

CommandOptions

Returns

Command

Accessors

execPath

Get Signature

get execPath(): string;
Returns

string


options

Get Signature

get options(): CommandOptions;
Returns

CommandOptions

Methods

spawn()

spawn(): ChildProcess;

Spawn a child process.

Returns

ChildProcess

It returns a child process.

Throws

Throws Error if failed to spawn the child process.

Example

try {
const cmd = new Rsvim.proc.Command("ls");
const child = cmd.spawn();
} catch (e) {
Rsvim.cmd.echo(`Failed to spawn child process: ${e}`);
}