Skip to content

Commit

Permalink
improve readme (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlaziuk authored Jan 20, 2018
1 parent 350dd92 commit 22d7da7
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,35 @@
[![downloads](https://img.shields.io/npm/dm/asap-es.svg)](https://www.npmjs.com/package/asap-es)
[![license](https://img.shields.io/npm/l/asap-es.svg)](https://www.npmjs.com/package/asap-es)

use all advantages of queues with promises!
Use all advantages of queues with promises!

## installation

``` sh
npm install asap-es
```

## why

The main goal is to provide lightweight and modern library for queuing tasks.
The name was inspired by the [asap](https://github.com/kriskowal/asap) library.
There is already a few libraries with similar functionality, yet this is another one.

| lib | async | sync | concurrency | browser | server | size | license |
| ---: | :---: | :---: | :---: | :---: | :---: | :---: | :--- |
| [asap-es](https://github.com/tlaziuk/asap-es) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 2.5 kB | MIT |
| [asap](https://github.com/kriskowal/asap) | ✖️ | ✔️ | ✖️ | ✔️ | ✔️ | 848 B | MIT |
| [d3-queue](https://github.com/d3/d3-queue) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 968 B | BSD-3-Clause |
| [aurelia-task-queue](https://github.com/aurelia/task-queue) | ✔️ | ✔️ | ✖️ | ✖️ | ✔️ | 3.11 kB | MIT |
| [kueue](https://github.com/jasonkneen/kueue) | ✔️ | ✔️ | ✖️ | ✔️ | ✔️ | 555 B | Apache 2.0 |

## api

| name | description |
| ---: | :--- |
| `ASAP.prototype.concurrency` | the number of tasks to run sumulatenously (1 by default) |
| `ASAP.prototype.enqueue(task)` | enqueue new task, returns a promise which resolves when execution of the task is returned, the task is ma function which returns a value or a promise |

## usage

``` typescript
Expand All @@ -27,4 +48,4 @@ const queue = new asap();
queue.enqueue(() => Promise.resolve(2)).then(console.log);
// console >> 2
});
```
```

0 comments on commit 22d7da7

Please sign in to comment.