Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 419 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 419 Bytes

wait-group-promise

An implementation of the Go's WaitGroup for Node.js.

Installation

npm install --save wait-group-promise

Usage

const WaitGroup = require('wait-group-promise');

const wg = new WaitGroup();

wg.add(2);

const p = wg.wait();

setTimeout(() => {
  wg.done();
}, 5000);
  
setTimeout(() => {
  wg.done();
}, 3000);

await p;