How to use the are-we-there-yet.TrackerStream 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
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);

stream.addListener("change", (name, completed, tracker) => {
    console.log(`name: ${name}, completed: ${completed}`);
});

simple.finish();
console.log(group.debug());

are-we-there-yet

Keep track of the overall completion of many disparate processes

ISC
Latest version published 10 months ago

Package Health Score

64 / 100
Full package analysis

Similar packages