@anzerr/promise.util

small promise util

Usage no npm install needed!

<script type="module">
  import anzerrPromiseUtil from 'https://cdn.skypack.dev/@anzerr/promise.util';
</script>

README

Intro

GitHub Actions status | linter GitHub Actions status | publish GitHub Actions status | test

simple es6 promise util.

Install

npm install --save git+https://git@github.com/anzerr/promise.util.git
npm install --save @anzerr/promise.util

Example

Look at tests for more usage examples

const promise = require('promise.util');
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

promise.measure(() => {
    return promise.each(data, () => promise.delay(1000), 5);
}).then((res) => {
    console.log(Math.round(res / 1e9)) // 2
});