This package shares many similarities with listr, but is more suited for synchronous code.
npm install @hjvedvik/tasks
const Tasks = require('@hjvedvik/tasks')
const tasks = new Tasks([
{
title: 'Simple task',
task: (context, task) => {
// task.setProgress(1, 5)
// task.setStatus('')
// task.setSummary('')
// task.fail('')
}
},
{
title: 'Sub tasks',
skip: () => true, // true, false, string
task: () => new Tasks([
{
title: 'Another task',
task: () => {
// task.setProgress(1, 10)
}
}
])
}
])
tasks.run({
// context
})
- Render in TTY and non-TTY environments
- Determine a stable API
- Create tests