A Simple Sequential and Parallel Task List Runner for Terminal

Written by rap2h | Published 2019/09/08
Tech Story Tags: javascript | programming | node | tech | latest-tech-stories | parallel-task-list | simple-sequential-runner | terminal

TLDR Taskz is a library for Node.js, a simple sequential and parallel task list runner for terminal terminal. Create your task sequence in any script file then run it. Create a array of tasks:. Then pass it to the taskz function and run it to start the process:. Alternatively, you can also run tasks in parallel using taskz tasks in the terminal:. The function is called taskz. It is based on a simple task list that is a simple sequence of tasks.via the TL;DR App

Taskz is a library for Node.js, a simple sequential and parallel task list runner for terminal.

Getting Started

Install it via 
npm i taskz
. Create your task sequence in any script file then run it.
const taskz = require("taskz");

taskz([
  {
    text: "first task - sleeps for 200ms",
    task: async () => await new Promise(resolve => setTimeout(resolve, 200));
  },
  {
    text: "this task will fail",
    task: async () => {
      throw new Error("this task failed");
    }
  }
]).run();
So in other word, you have to create a array of tasks:
const myTasks = [
  { text: "task 1", task: () => { /* ... */ } },
  { text: "task 2", task: () => { /* ... */ } }
];
Then pass it to the 
taskz
 function and call 
run
 to start the process:
taskz(myTasks).run();
You can also run tasks in parallel:
taskz(myTasks, { parallel: true }).run();
Other features: 

Written by rap2h | https://raph.site
Published by HackerNoon on 2019/09/08