dotenvx-tui 2.0.0 → 2.0.1

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.
Files changed (3) hide show
  1. package/bin/cli.js +0 -0
  2. package/install.js +15 -2
  3. package/package.json +1 -1
package/bin/cli.js CHANGED
File without changes
package/install.js CHANGED
@@ -49,9 +49,22 @@ function downloadFile(url) {
49
49
  if (res.statusCode !== 200) {
50
50
  return reject(new Error(`Download failed: HTTP ${res.statusCode}`));
51
51
  }
52
+ const total = parseInt(res.headers["content-length"] || "0", 10);
52
53
  const chunks = [];
53
- res.on("data", (chunk) => chunks.push(chunk));
54
- res.on("end", () => resolve(Buffer.concat(chunks)));
54
+ let downloaded = 0;
55
+ res.on("data", (chunk) => {
56
+ chunks.push(chunk);
57
+ downloaded += chunk.length;
58
+ if (total > 0) {
59
+ const pct = Math.round((downloaded / total) * 100);
60
+ const mb = (downloaded / 1024 / 1024).toFixed(1);
61
+ process.stdout.write(`\r downloading... ${mb} MB (${pct}%)`);
62
+ }
63
+ });
64
+ res.on("end", () => {
65
+ if (total > 0) process.stdout.write("\n");
66
+ resolve(Buffer.concat(chunks));
67
+ });
55
68
  res.on("error", reject);
56
69
  })
57
70
  .on("error", reject);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotenvx-tui",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Full-screen terminal UI for managing dotenvx-encrypted environment variables",
5
5
  "repository": {
6
6
  "type": "git",