Skip to content

entwicklerstube/taskler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Taskler

Listr inspired Terminal task list but with callbacks instead of promises & observables

Install

yarn add taskler

Usage

const taskler = require('taskler')

const tasks = [{
  title: 'Do something',
  task: ({emit, succeed}) => {
    emit('start')

    setTimeout(() => {
      emit('still working...')
    }, 1000)

    setTimeout(() => {
      succeed()
    }, 2000)
  }
}, {
  title: 'Another task',
  task: ({emit, succeed}) => {
    emit('also starting..')

    setTimeout(() => {
      succeed()
    }, 1500)
  }
}]

taskler(tasks, () => {
  console.log('πŸŽ‰  All tasks are done')
})

Preview

Preview