Interface Parser<T>

Parser implementations convert stdout and stderr from the underlying child process to a more useable format. This can be a no-op passthrough if no parsing is necessary.

interface Parser<T> ((stdout, stderr, passed) => T | Promise<T>)

Type Parameters

  • T
  • Invoked once per task.

    Parameters

    • stdout: string

      the concatenated stream from stdin, stripped of the PASS or FAIL tokens from BatchProcessOptions.

    • stderr: undefined | string

      if defined, includes all text emitted to stderr.

    • passed: boolean

      true iff the PASS pattern was found in stdout.

    Returns T | Promise<T>

    Throws

    an error if the Parser implementation wants to reject the task. It is valid to raise Errors if stderr is undefined.

    See

    BatchProcessOptions