@hjvedvik/tasks
v0.0.8
Published
Terminal task list
Downloads
13,367
Readme
@hjvedvik/tasks
This package shares many similarities with listr, but is more suited for synchronous code.
Install
npm install @hjvedvik/tasks
Usage
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
})
Roadmap for v1.0
- [x] Render in TTY and non-TTY environments
- [ ] Determine a stable API
- [ ] Create tests