progressLoader
Creates a progress loader for tracking progress of operations with multiple items.
Usage

const progress = await io
.progressLoader({
title: 'Processing Orders',
description: 'Processing orders in queue',
itemsInQueue: 10,
})
.start()
// Process items one by one
for (let i = 0; i < orders.length; i++) {
await processOrder(orders[i])
await progress.increment()
}
await progress.stop()Props
| Prop | Description | Type | Required | Default |
|---|---|---|---|---|
| title | Title of the progress operation | string | Yes | — |
| description | Optional description of the progress operation | string | No | undefined |
| itemsInQueue | The total number of items in the queue | number | Yes | — |
Returns
Returns a ProgressLoader instance with start(), increment(), update(itemsCompleted), and stop() methods.
Examples
Progress tracking
const progress = await io
.progressLoader({
title: 'Processing Orders',
itemsInQueue: orders.length,
})
.start()
try {
for (const order of orders) {
await processOrder(order)
await progress.increment()
}
} finally {
await progress.stop()
}