Options
All
  • Public
  • Public/Protected
  • All
Menu

Extend the task to have more functionality while accessing from the outside.

Type parameters

Hierarchy

  • TaskWrapper

Index

Constructors

Properties

errors: ListrError<Ctx>[]
task: Task<Ctx, typeof ListrRenderer>

Accessors

  • get output(): string
  • set output(data: string): void
  • Get the output from the output channel.

    Returns string

  • Send a output to the output channel.

    Parameters

    • data: string

    Returns void

  • get title(): string
  • set title(data: string): void
  • Get the title of the current task.

    Returns string

  • Change the title of the current task.

    Parameters

    • data: string

    Returns void

Methods

  • cancelPrompt(throwError?: boolean): void
  • Cancels the current prompt attach to this task.

    Parameters

    • Optional throwError: boolean

    Returns void

  • isRetrying(): undefined | { count: number; withError?: any }
  • Get the number of retrying, else returns false

    Returns undefined | { count: number; withError?: any }

  • Create a new subtask with given renderer selection from the parent task.

    Type parameters

    • NewCtx = Ctx

    Parameters

    Returns Listr<NewCtx, any, any>

  • Create a new Enquirer prompt using prompt options.

    Since process.stdout is controlled by Listr, this will passthrough all Enquirer data through internal stdout.

    Type parameters

    • T = any

    Parameters

    Returns Promise<T>

  • Report a error in process for error collection.

    Parameters

    Returns void

  • run(ctx: Ctx): Promise<void>
  • Run this task.

    Parameters

    • ctx: Ctx

    Returns Promise<void>

  • skip(message?: string): void
  • Skip current task.

    Parameters

    • Optional message: string

    Returns void

  • stdout(): WriteStream & WritableStream
  • Pass stream of data to internal stdout.

    Since Listr2 takes control of process.stdout utilizing the default renderer, any data outputted to process.stdout will corrupt its looks.

    This returns a fake stream to pass any stream inside Listr as task data.

    Returns WriteStream & WritableStream