npm

Need private packages and team management tools?Check out npm Orgs. »

@hjvedvik/tasks

0.0.8 • Public • Published

@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

  • Render in TTY and non-TTY environments
  • Determine a stable API
  • Create tests

install

npm i @hjvedvik/tasks

Downloadsweekly downloads

3,523

version

0.0.8

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability