update README
This commit is contained in:
parent
19beb95e20
commit
7a3aed275f
27
README.md
27
README.md
@ -1,5 +1,5 @@
|
|||||||
# taskbuffer
|
# taskbuffer
|
||||||
Flexible task organization for gulp.
|
Flexible task organization for gulp. TypeScript ready!
|
||||||
|
|
||||||
## Status
|
## Status
|
||||||
[![Coverage Status](https://coveralls.io/repos/github/pushrocks/taskbuffer/badge.svg?branch=master)](https://coveralls.io/github/pushrocks/taskbuffer?branch=master)
|
[![Coverage Status](https://coveralls.io/repos/github/pushrocks/taskbuffer/badge.svg?branch=master)](https://coveralls.io/github/pushrocks/taskbuffer?branch=master)
|
||||||
@ -12,7 +12,7 @@ npm install taskbuffer --save
|
|||||||
|
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
#### Task
|
### class `Task`
|
||||||
* A Task in its most simple form is a function that is executed when the task runs.
|
* A Task in its most simple form is a function that is executed when the task runs.
|
||||||
* A Task can have a **preTask** and an **afterTask**
|
* A Task can have a **preTask** and an **afterTask**
|
||||||
(those are run before or after the main function whenever the task is called)
|
(those are run before or after the main function whenever the task is called)
|
||||||
@ -27,6 +27,25 @@ npm install taskbuffer --save
|
|||||||
* Task.triggered() is an Observable stream that emits events every time a task call is called and every time a call is completed.
|
* Task.triggered() is an Observable stream that emits events every time a task call is called and every time a call is completed.
|
||||||
* Task is compatible to gulp streams.
|
* Task is compatible to gulp streams.
|
||||||
|
|
||||||
#### Taskchain
|
### class `TaskChain`
|
||||||
* Multiple Tasks can be combined in a bigger task using a Taskchain. Taskchain extends Task.
|
* Multiple Tasks can be combined in a bigger task using a Taskchain.
|
||||||
|
* Taskchain extends Task.
|
||||||
|
* While the tasks are async in themselve, TaskChain **runs Tasks serialized** (one after the other)
|
||||||
|
* that means that tasks can rely on each other and
|
||||||
|
|
||||||
|
### class `TaskParallel`
|
||||||
|
* like TaskChain, however **tasks run in parallel**
|
||||||
|
* Tasks cannot rely on each other
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
We highly recommend TypeScript as this module supports **TypeScript intellisense**.
|
||||||
|
```
|
||||||
|
import * as taskbuffer from "taskbuffer";
|
||||||
|
|
||||||
|
myTask = new taskbuffer.Task({
|
||||||
|
name:"myTask1",
|
||||||
|
taskFunction:() => {
|
||||||
|
//do some stuff and return promise
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "taskbuffer",
|
"name": "taskbuffer",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "manage triggers and execution of tasks with promises",
|
"description": "Flexible task organization for gulp. TypeScript ready!",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npmts)"
|
"test": "(npmts)"
|
||||||
|
Loading…
Reference in New Issue
Block a user