m-tasker

1.0.1 • Public • Published

Mini task runner that can support async。

Build Status Coverage Status Downloads Version License

## useage

Install

npm install m-tasker

//require m-tasker
const Tasker = require('m-taker');

const app = new Tasker();

// add a task;
app.add(function(next){
  //dosomething 
  next(123,222);
})

// you can pass many arguments like this;
app.add(function(next, ...args){
  console.log(args)
  // => [123,222]
})

app.setEnd(function(...arg){
  //when tasks were ended;
  //callback
})
app.run()

API

add

// must be called next() when task was done;
 Tasker.add(function(next){next()})

setEnd

  // task list completed
  Tasker.setEnd(function(args){
    //doString
  })

run

run tasklist

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i m-tasker

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • nunn