API Docs

TaskBuilder class for fluent task construction

Properties

This type has no properties.

Methods

withArgs(...args) -> TaskBuilder

Add arguments

withArgs(...args) -> TaskBuilder
Name Type Description
...args string[] - Arguments to add
This builder, for chaining

withEnvironment(environment) -> TaskBuilder

Set environment variables

withEnvironment(environment) -> TaskBuilder
Name Type Description
environment Object - Environment variables
This builder, for chaining

inDirectory(directory) -> TaskBuilder

Set working directory

inDirectory(directory) -> TaskBuilder
Name Type Description
directory string - Working directory path
This builder, for chaining

onOutput(callback) -> TaskBuilder

Set output callback

onOutput(callback) -> TaskBuilder
Name Type Description
callback Function - Output callback (stream, data) => {}
This builder, for chaining

withInput(input) -> TaskBuilder

Set text to write to the task's standard input when it is run with run(). A task made with build() has to be given its input with sendInput() and closeInput() after start(), so build() throws if this has been set

withInput(input) -> TaskBuilder
Name Type Description
input string - Text to write to standard input
This builder, for chaining

run() -> Promise<object>

Build and run the task

run() -> Promise<{exitCode: number, stdout: string, stderr: string}>
Promise<object>
The task's result
Field Type Description
exitCode number
stdout string
stderr string

build() -> HSTask

Build the task without running

build() -> HSTask
The created task, not yet started