nodejsscript • Docs
nodejsscript / s / 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);
String of command(s) to be executed. Defined patterns (by default /::([^:]+)::/g
) will be replaced by actual value.
Arguments for command
.
Silence and synchronous options.
runA(
command
,vars
):ProcessPromise
• 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.
String of command(s) to be executed. Defined patterns (by default /::([^:]+)::/g
) will be replaced by actual value.
Arguments for command
.
Silence and synchronous options.
runA(
command
,vars
,options
):ProcessPromise
• 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.
String of command(s) to be executed. Defined patterns (by default /::([^:]+)::/g
) will be replaced by actual value.
Arguments for command
.
Silence and synchronous options.