@absolunet/ioc2.1.0

View on GitHub

CommandRunner

Class that is used to run a command instance through the wanted pipes.

Members

(static) dependencies :Array.<string>

Source:
Class dependencies: ['app'].

Methods

run(command, argv, yargsopt)

Source:
Run command based on argv object. If an exception occurs, handle it with the application exception handler.
Parameters:
Name Type Attributes Description
command console.Command The command instance.
argv object.<string, string> The Yargs arguments.
yargs Yargs <optional>
The Yargs instance.
Returns:
The async process promise.
Type
Promise

(async) unsafeRun(command, argv, yargsopt)

Source:
Run command based on argv object. If an exception occurs, throw it withing catching it through the application exception handler.
Parameters:
Name Type Attributes Description
command console.Command The command instance.
argv object.<string, string> The Yargs arguments.
yargs Yargs <optional>
The Yargs instance.
Returns:
The async process promise.
Type
Promise

(async) runPreprocess(command, argvopt)

Source:
Run command preprocess.
Parameters:
Name Type Attributes Default Description
command console.Command The command instance.
argv object.<string, string> <optional>
{} The Yargs arguments.
Returns:
The async process promise.
Type
Promise

runHandle(command)

Source:
Run command handle method.
Parameters:
Name Type Description
command console.Command The command instance.
Returns:
The async process promise with the possible returned data from the command.
Type
Promise.<*>

(async) runPostprocess(command, dataopt)

Source:
Run command postprocess.
Parameters:
Name Type Attributes Description
command console.Command The command instance.
data * <optional>
The data to use when postprocessing.
Returns:
The async process promise.
Type
Promise