Class: Runner

arpen/services/runner~ Runner

Command execution service

pty.js module is required

new Runner()

Create the service

Members


<static> provides :string

Service name is 'runner'
Type:
  • string

<static> requires :Array.<string>

Dependencies as constructor arguments
Type:
  • Array.<string>

<static> execTimeout

Command execution time limit

Methods


<async> exec(command [, params] [, options])

Execute a command
Parameters:
Name Type Argument Description
command string Command name
params Array.<string> <optional>
Command arguments
options object <optional>
execFile() options with the following addition
Properties
Name Type Argument Description
pipe object <optional>
The command's stdout, stderr will be piped to this process and stdin of this process will be piped to the command
Returns:
{
  code: 0,
  signal: null,
  stdout: '',
  stderr: '',
}
Type
Promise

spawn(command [, params] [, options] [, expect])

Spawn a command
Parameters:
Name Type Argument Description
command string Command name
params Array.<string> <optional>
Command arguments
options object <optional>
Pty.js options
expect Map <optional>
Expect-send map { /regexp/: 'send this' }
Returns:
Type
Subprocess