@trap_stevo/filetide 0.0.49 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -108,7 +108,7 @@ class ConsoleProgressBarManager {
108
108
  };
109
109
  },
110
110
  redraw: () => {
111
- if (!isNaN(newBar.taskIndex) && !isNaN(this.barsPerPage)) {
111
+ if (!isNaN(newBar.taskIndex) && !isNaN(this.barsPerPage) && process.stdout.isTTY) {
112
112
  readline.cursorTo(process.stdout, 0, newBar.taskIndex % this.barsPerPage);
113
113
  process.stdout.clearLine();
114
114
  }
@@ -260,7 +260,9 @@ class ConsoleProgressBarManager {
260
260
  clearPage() {
261
261
  for (let i = 0; i < this.barsPerPage + 2; i++) {
262
262
  readline.cursorTo(process.stdout, 0, i);
263
- process.stdout.clearLine();
263
+ if (process.stdout.isTTY) {
264
+ process.stdout.clearLine();
265
+ }
264
266
  }
265
267
  }
266
268
  displayPage(customPagePrefix = "Page", bottomMessage, bottomMessageColor = chalk.gray) {
@@ -276,7 +278,7 @@ class ConsoleProgressBarManager {
276
278
  }
277
279
  redrawCompletionFeed(customPagePrefix = "Page", bottomMessage, pageFooterMessageColor = chalk.blue, bottomMessageColor = chalk.gray, recentlyCompletedColor = chalk.green) {
278
280
  const bottomPosition = this.barsPerPage;
279
- if (!isNaN(bottomPosition)) {
281
+ if (!isNaN(bottomPosition) && process.stdout.isTTY) {
280
282
  readline.cursorTo(process.stdout, 0, bottomPosition);
281
283
  process.stdout.clearLine();
282
284
  }
@@ -284,7 +286,7 @@ class ConsoleProgressBarManager {
284
286
  if (this.completionFeed.length > 0) {
285
287
  process.stdout.write(recentlyCompletedColor(` | Recently completed: ${this.completionFeed.join(", ")}`));
286
288
  }
287
- if (!isNaN(bottomPosition)) {
289
+ if (!isNaN(bottomPosition) && process.stdout.isTTY) {
288
290
  readline.cursorTo(process.stdout, 0, bottomPosition + 1);
289
291
  process.stdout.clearLine();
290
292
  }
@@ -293,7 +295,7 @@ class ConsoleProgressBarManager {
293
295
  }
294
296
  }
295
297
  listenForInput(customPagePrefix = "Page", bottomMessage, bottomMessageColor = chalk.gray, recentlyCompletedColor = chalk.green) {
296
- if (!isNaN(this.barsPerPage)) {
298
+ if (!isNaN(this.barsPerPage) && process.stdout.isTTY) {
297
299
  process.stdin.setRawMode(true);
298
300
  process.stdin.resume();
299
301
  }
@@ -315,13 +317,17 @@ class ConsoleProgressBarManager {
315
317
  }
316
318
  exitInputListener() {
317
319
  process.stdin.removeListener("data", this.inputListener);
318
- process.stdin.setRawMode(false);
319
- process.stdin.resume();
320
+ if (process.stdout.isTTY) {
321
+ process.stdin.setRawMode(false);
322
+ process.stdin.resume();
323
+ }
320
324
  }
321
325
  displayCompletionMessage() {
322
326
  const lastLine = Math.min(this.taskBars.length, this.barsPerPage);
323
327
  readline.cursorTo(process.stdout, 0, lastLine);
324
- process.stdout.clearLine();
328
+ if (process.stdout.isTTY) {
329
+ process.stdout.clearLine();
330
+ }
325
331
  console.log(this.completionMessageColor(this.completionMessage));
326
332
  }
327
333
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trap_stevo/filetide",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "description": "Revolutionizing real-time file transfer with seamless, instant communication across any device. Deliver files instantly, regardless of platform, and experience unparalleled speed and control in managing transfers. Elevate your file-sharing capabilities with a tool designed for precision, efficiency, and effortless connectivity.",
5
5
  "main": "dist/cjs/FileTide.js",
6
6
  "scripts": {