npm.io
0.0.1 • Published 4 years ago

synca

Licence
MIT
Version
0.0.1
Deps
0
Size
6 kB
Vulns
0
Weekly
0

synca

Downloads Version License Language Typescript

Usage

with Deno

import { concurrent } from "https://deno.land/x/synca/mod.ts";

const co = concurrent(4 /* concurrency */);

for (let i = 0; i < 100; i++) {
  await co.run(async () => {
    await fetch(`https://something/articles/${i}`);
  });
}

await co.wait(); // remain works..
with Node.js & Browser

Install

npm install synca
import { concurrent } from "synca";

// Usage is as above :-)