Skip to content

Documentation / listr2 / ListrOptions

Interface: ListrOptions<Ctx> ​

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

Options to set the behavior of Listr.

Extended by ​

Type Parameters ​

Ctx ​

Ctx = ListrContext

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


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


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


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


collectErrors? ​

optional collectErrors?: boolean

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

Collects errors inside the Listr.errors.

  • false will collect no errors, leaving Listr.errors as null.
  • true will collect the error message, the type and the location of the failed task.

Default Value ​

false

See ​

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


registerSignalListeners? ​

optional registerSignalListeners?: boolean

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

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

fallbackRendererCondition? ​

optional fallbackRendererCondition?: boolean | (() => boolean)

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

Determine the certain condition required to use the fallback renderer.

Default Value ​

ts
handled internally

silentRendererCondition? ​

optional silentRendererCondition?: boolean | (() => boolean)

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

Determine the certain condition required to use the silent renderer.

Default Value ​

ts
handled internally

forceTTY? ​

optional forceTTY?: boolean

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

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

Default Value ​

false


forceUnicode? ​

optional forceUnicode?: boolean

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

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

Default Value ​

false