How to use the are-we-there-yet.Tracker function in are-we-there-yet

To help you get started, we’ve selected a few are-we-there-yet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / are-we-there-yet / are-we-there-yet-tests.ts View on Github external
import { Tracker, TrackerStream, TrackerGroup } from "are-we-there-yet";

const simple = new Tracker("simple");
simple.addListener("change", (name, completed, tracker) => {
    console.log(`name: ${name}, completed: ${completed}`);
});
simple.addWork(10);
simple.completeWork(1);
console.log(simple.completed() < 1);

const group = new TrackerGroup("group");
group.addUnit(simple);

const subgroup = group.newGroup("subgroup");
console.log(group.completed());

const stream = new TrackerStream("stream", 100, { encoding: "utf8" });
subgroup.addUnit(stream);

are-we-there-yet

Keep track of the overall completion of many disparate processes

ISC
Latest version published 12 months ago

Package Health Score

64 / 100
Full package analysis

Similar packages