From 22d7da798c4f3ef6a00fbdcd5b8a859d39177e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Sat, 20 Jan 2018 09:48:37 +0100 Subject: [PATCH] improve readme (#1) --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3cbff68..820ecff 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![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 @@ -17,6 +17,27 @@ use all advantages of queues with promises! 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 @@ -27,4 +48,4 @@ const queue = new asap(); queue.enqueue(() => Promise.resolve(2)).then(console.log); // console >> 2 }); -``` \ No newline at end of file +```