added logging

This commit is contained in:
2024-05-13 09:34:43 -07:00
parent 5da3eb99bd
commit 2296d13654
5 changed files with 68 additions and 19 deletions
+26
View File
@@ -1,3 +1,6 @@
import { cursorTo } from "readline";
export class ReactionTypeCount {
constructor({ count, reactionType }) {
this.count = count;
@@ -27,4 +30,27 @@ export class GenericEntity {
constructor(data) {
Object.assign(this, data);
}
}
export class LoadingBar {
constructor(size) {
this.size = size;
this.cursor = 0;
this.timer = null;
cursorTo(process.stdout, this.cursor);
// draw the initial outline
process.stdout.write("\x1B[?25l");
for (let i = 0; i < this.size; i++) {
process.stdout.write("\u2591");
}
}
increment(amt) {
cursorTo(process.stdout, this.cursor);
for (let i = 0; i < amt; i++) process.stdout.write("\u2588");
this.cursor += amt;
}
}