Package detail

@hjvedvik/tasks

hjvedvik14.4kMIT0.0.8

Terminal task list

task, list, progress, terminal

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

changelog

0.0.8 (2018-09-17)

Bug Fixes

  • log: render durations when 0s (8e342f2)
  • log: use gray instead of dim (471edbe)
  • progress: do not exceed 100% (4c64c07)
  • progress: use u2500 character to remove gaps (8305521)

Features

  • log: non-tty renderer (6873686)
  • log: render starting task in non-tty (a13a66f)
  • task: exit arg for task.fail() method (701926f)
  • task: exitOnError option (default true) (7152d54)
  • fps option (9b9877c)

Performance Improvements

  • log: render at maximum 60 fps (5b79f55)

0.0.7 (2018-08-07)

0.0.6 (2018-08-07)

Features

  • theme: customize succes, progress and fail colors (80634b7)

0.0.5 (2018-08-07)

0.0.4 (2018-08-07)

Bug Fixes

  • task: render skipped task correctly (0ee76d0)

0.0.3 (2018-08-07)

Features

  • task: option to skip task (ea19651)
  • tasks: render final summary (6cb0c1d)

0.0.2 (2018-08-06)