Skip to content

Latest commit

 

History

History
110 lines (63 loc) · 2.52 KB

File metadata and controls

110 lines (63 loc) · 2.52 KB

nodejsscriptDocs


nodejsscript / s / runA

Function: runA()

Executes the given command asynchronously, the function arguments are the same as for s.run function except that the child_process.spawn is used internally.

s.runA`git branch --show-current`;
s.runA`echa ${"Hello World"}`;
s.runA("echo ::var::", { var: "Hello World" });
s.runA("echo 'HI'", null, { cwd: "../" });

The function returns a ProcessPromise object.

const result_a= await s.$().runA("git branch --show-current");
echo(result_a.toString());

const result_b= await s.$().runA("git branch --show-::var::", { var: "current" }, { silent: true });
echo(result_b.toString());

const ch= s.$().runA`git branch --show-current`;
ch.child.on("data", echo);

Param

String of command(s) to be executed. Defined patterns (by default /::([^:]+)::/g) will be replaced by actual value.

Param

Arguments for command.

Param

Silence and synchronous options.

runA(command, vars)

runA(command, vars): ProcessPromise

Parameters

command: string

String of command(s) to be executed. Defined patterns (by default /::([^:]+)::/g) will be replaced by actual value.

vars: false | object

Arguments for command.

Returns

ProcessPromise

Returns ProcessPromise.

Param

String of command(s) to be executed. Defined patterns (by default /::([^:]+)::/g) will be replaced by actual value.

Param

Arguments for command.

Param

Silence and synchronous options.

runA(command, vars, options)

runA(command, vars, options): ProcessPromise

Parameters

command: string

String of command(s) to be executed. Defined patterns (by default /::([^:]+)::/g) will be replaced by actual value.

vars: false | object

Arguments for command.

options: RunOptions

Silence and options.

Returns

ProcessPromise

Returns ProcessPromise.

Param

String of command(s) to be executed. Defined patterns (by default /::([^:]+)::/g) will be replaced by actual value.

Param

Arguments for command.

Param

Silence and synchronous options.