Skip to content

Manager

Manager is a great way to create a custom-tailored Listr class once and then utilize it more than once.

Example

You can find the related examples here.

You can also find a real-world use case here.

DANGER

@listr2/manager is an optional peer dependency. Please install it first.

bash
npm i @listr2/manager
bash
yarn add @listr2/manager
bash
pnpm i @listr2/manager

Idea

The idea of having an additional task manager is to create a higher-order factory to create Listr on demand with always your options. This allows you to not store your options as variables that you inject every time you create a new Listr but store it in a stateful Manager where you can initiate as many Listr task lists as you want.

It can alternatively be used as a single-task list for ongoing actions where you can add more tasks as you like. This is also possible through Listr but not as convenient to do.