Skip to content

Documentation / listr2 / ListrBaseClassOptions

Interface: ListrBaseClassOptions<Ctx, Renderer, FallbackRenderer>

Defined in: packages/listr2/src/interfaces/listr.interface.ts:105

Parent Listr has more options where you can also change global settings.

Any subtasks will respect those options so they will be stripped of that properties.

Extends

Type Parameters

Ctx

Ctx = ListrContext

Renderer

Renderer extends ListrRendererValue = ListrPrimaryRendererValue

FallbackRenderer

FallbackRenderer extends ListrRendererValue = ListrSecondaryRendererValue

Properties

ctx?

optional ctx: Ctx

Defined in: packages/listr2/src/interfaces/listr.interface.ts:24

Inject a context through this options wrapper.

Default Value

{}

See

https://listr2.kilic.dev/listr/context.html

Inherited from

ListrOptions.ctx


concurrent?

optional concurrent: number | boolean

Defined in: packages/listr2/src/interfaces/listr.interface.ts:34

Concurrency limits how many tasks will be running in parallel.

  • false will only run a single task at a time.
  • true will set it to Infinity to run all the tasks in parallel.
  • Given a number it will limit the concurrency to that number.

Default Value

false

Inherited from

ListrOptions.concurrent


exitOnError?

optional exitOnError: boolean

Defined in: packages/listr2/src/interfaces/listr.interface.ts:43

Determine the default behavior of exiting on errors.

  • true will exit the current Listr whenever it encounters an error.
  • false will continue the execution of current Listr if it encounters an error.

Default Value

true

Inherited from

ListrOptions.exitOnError


exitAfterRollback?

optional exitAfterRollback: boolean

Defined in: packages/listr2/src/interfaces/listr.interface.ts:55

Determine the behavior of exiting after rollback actions.

This is independent of exitOnError, since failure of a rollback can be a more critical operation comparing to failing a single task.

  • true will stop the execution whenever a rollback happens.
  • false will continue after successfully recovering from a rollback.

Default Value

true

Inherited from

ListrOptions.exitAfterRollback


collectErrors?

optional collectErrors: false | "minimal" | "full"

Defined in: packages/listr2/src/interfaces/listr.interface.ts:66

Collects errors inside the Listr.errors.

  • false will collect no errors.
  • minimal will only collect the error message and the location.
  • full will clone the current context and task in to the error instance.

Default Value

false

See

https://listr2.kilic.dev/task/error-handling.html#collected-errors

Inherited from

ListrOptions.collectErrors


registerSignalListeners?

optional registerSignalListeners: boolean

Defined in: packages/listr2/src/interfaces/listr.interface.ts:73

Listr will track SIGINIT signal to update the renderer one last time before failing, therefore it needs to register exit listeners.

Default Value

ts
true

Inherited from

ListrOptions.registerSignalListeners


fallbackRendererCondition?

optional fallbackRendererCondition: boolean | () => boolean

Defined in: packages/listr2/src/interfaces/listr.interface.ts:79

Determine the certain condition required to use the fallback renderer.

Default Value

ts
handled internally

Inherited from

ListrOptions.fallbackRendererCondition


silentRendererCondition?

optional silentRendererCondition: boolean | () => boolean

Defined in: packages/listr2/src/interfaces/listr.interface.ts:85

Determine the certain condition required to use the silent renderer.

Default Value

ts
handled internally

Inherited from

ListrOptions.silentRendererCondition


forceTTY?

optional forceTTY: boolean

Defined in: packages/listr2/src/interfaces/listr.interface.ts:91

Forces TTY stdout even though your current output may not be compatible.

Default Value

false

Inherited from

ListrOptions.forceTTY


forceUnicode?

optional forceUnicode: boolean

Defined in: packages/listr2/src/interfaces/listr.interface.ts:97

Forces unicode icons even though your current output may not be compatible.

Default Value

false

Inherited from

ListrOptions.forceUnicode


renderer?

optional renderer: Renderer

Defined in: packages/listr2/src/interfaces/renderer.interface.ts:90

Default renderer preferred.

Inherited from

ListrPrimaryRendererSelection.renderer


rendererOptions?

optional rendererOptions: ListrGetRendererOptions<Renderer>

Defined in: packages/listr2/src/interfaces/renderer.interface.ts:96

Renderer options depending on the current renderer.

Inherited from

ListrPrimaryRendererSelection.rendererOptions


fallbackRenderer?

optional fallbackRenderer: FallbackRenderer

Defined in: packages/listr2/src/interfaces/renderer.interface.ts:108

Fallback renderer preferred.

Inherited from

ListrSecondaryRendererSelection.fallbackRenderer


fallbackRendererOptions?

optional fallbackRendererOptions: ListrGetRendererOptions<FallbackRenderer>

Defined in: packages/listr2/src/interfaces/renderer.interface.ts:114

Renderer options depending on the fallback renderer.

Inherited from

ListrSecondaryRendererSelection.fallbackRendererOptions