@ayush24k/telezipper 1.1.0 β†’ 1.2.0

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.
package/README.md CHANGED
@@ -2,11 +2,27 @@
2
2
 
3
3
  Split folders into multiple 2GB zip files with optional Telegram upload.
4
4
 
5
+ [![npm version](https://img.shields.io/npm/v/@ayush24k/telezipper.svg)](https://www.npmjs.com/package/@ayush24k/telezipper)
6
+ [![npm downloads](https://img.shields.io/npm/dm/@ayush24k/telezipper.svg)](https://www.npmjs.com/package/@ayush24k/telezipper)
7
+
5
8
  ## Installation
6
9
 
7
- Install globally using npm link:
10
+ ### Option 1: Install from npm (Recommended)
11
+
12
+ Install globally from npm:
13
+
14
+ ```bash
15
+ npm install -g @ayush24k/telezipper
16
+ ```
17
+
18
+ Now you can use `telezipper` from anywhere on your system!
19
+
20
+ ### Option 2: Install from source
21
+
22
+ Clone the repository and link locally:
8
23
 
9
24
  ```bash
25
+ git clone https://github.com/ayush24k/teleZipper.git
10
26
  cd /path/to/telezipper
11
27
  npm install
12
28
  npm run build
@@ -24,11 +24,11 @@ program
24
24
  const useTelegram = program.opts().telegram || false;
25
25
  const botToken = program.opts().botToken;
26
26
  const chatId = program.opts().chatId;
27
- console.log(`πŸ•ΈοΈ Crawling files in ${source}...`);
27
+ console.log(`\nπŸ•ΈοΈ Crawling files in ${source}...`);
28
28
  const files = await (0, crawler_1.crawl)(source);
29
- console.log(`πŸ“‚ Found ${files.length} files. Chunking...`);
29
+ console.log(`πŸ“‚ Found ${files.length} file${files.length !== 1 ? 's' : ''}`);
30
30
  const chunks = (0, chunking_1.chunkFiles)(files);
31
- console.log(`πŸ“¦ Created ${chunks.length} chunks. Zipping...`);
31
+ console.log(`πŸ“¦ Created ${chunks.length} chunk${chunks.length !== 1 ? 's' : ''} (max 2GB each)\n`);
32
32
  await (0, zipper_1.zipChunks)(chunks, outputDir, useTelegram, botToken, chatId);
33
- console.log("πŸŽ‰ process done!");
33
+ console.log(`\nπŸŽ‰ All done! ${useTelegram ? 'Files uploaded to Telegram.' : `Zips saved to ${outputDir}`}`);
34
34
  })();
@@ -6,17 +6,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.uploadToTelegram = uploadToTelegram;
7
7
  const node_telegram_bot_api_1 = __importDefault(require("node-telegram-bot-api"));
8
8
  const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
9
10
  const cli_progress_1 = __importDefault(require("cli-progress"));
11
+ // Suppress the polling deprecation warning
12
+ process.env.NTBA_FIX_350 = "1";
10
13
  // upload a zip file to telegram with progress bar
11
14
  async function uploadToTelegram(zipPath, botToken, chatId) {
12
15
  const bot_token = botToken || process.env.TELEGRAM_BOT_TOKEN || "";
13
16
  const chat_id = chatId || process.env.TELEGRAM_CHAT_ID || "";
14
17
  if (!bot_token || !chat_id) {
15
- throw new Error("Telegram credentials are missing. Please provide --bot-token and --chat-id or set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID environment variables.");
18
+ throw new Error("❌ Telegram credentials are missing. Please provide --bot-token and --chat-id or set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID environment variables.");
16
19
  }
17
20
  const bot = new node_telegram_bot_api_1.default(bot_token, { polling: false });
18
21
  const totalSize = fs_1.default.statSync(zipPath).size;
19
- console.log(`πŸ“€ Uploading ${zipPath}`);
22
+ const fileName = path_1.default.basename(zipPath);
23
+ const fileSizeMB = (totalSize / (1024 * 1024)).toFixed(2);
24
+ console.log(`\nπŸ“€ Uploading ${fileName} (${fileSizeMB} MB)`);
20
25
  const progressBar = new cli_progress_1.default.SingleBar({
21
26
  format: "Uploading [{bar}] {percentage}% | {value}/{total} Bytes",
22
27
  }, cli_progress_1.default.Presets.shades_classic);
@@ -29,5 +34,5 @@ async function uploadToTelegram(zipPath, botToken, chatId) {
29
34
  });
30
35
  await bot.sendDocument(chat_id, stream);
31
36
  progressBar.stop();
32
- console.log("βœ… Upload complete");
37
+ console.log(`βœ… ${fileName} uploaded successfully`);
33
38
  }
@@ -15,7 +15,7 @@ async function zipChunks(chunks, outputDir, useTelegram, botToken, chatId) {
15
15
  for (let i = 0; i < chunks.length; i++) {
16
16
  const zipName = `chunk_${i + 1}.zip`;
17
17
  const zipPath = path_1.default.join(outputDir, zipName);
18
- console.log(`πŸ“¦ Zipping ${zipName}`);
18
+ console.log(`πŸ“¦ Zipping ${zipName}...`);
19
19
  const progressBar = new cli_progress_1.default.SingleBar({
20
20
  format: `Zipping ${zipName} [{bar}] {percentage}% | {value}/{total} files`,
21
21
  }, cli_progress_1.default.Presets.shades_classic);
@@ -41,7 +41,7 @@ async function zipChunks(chunks, outputDir, useTelegram, botToken, chatId) {
41
41
  });
42
42
  }
43
43
  if (useTelegram) {
44
- console.log("πŸš€ Uploading all zips to Telegram...");
44
+ console.log("\nπŸš€ Uploading all files to Telegram...");
45
45
  await Promise.all(uploadQueue);
46
46
  }
47
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ayush24k/telezipper",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Split folders into multiple 2GB zip files with optional Telegram upload made for personal use.",
5
5
  "files": [
6
6
  "dist"
@@ -12,8 +12,22 @@
12
12
  "test": "echo \"Error: no test specified\" && exit 1",
13
13
  "build": "tsc"
14
14
  },
15
- "keywords": [],
16
- "author": "",
15
+ "keywords": [
16
+ "telegram",
17
+ "zip",
18
+ "file-upload",
19
+ "chunking",
20
+ "cli",
21
+ "telegram-bot",
22
+ "file-compression",
23
+ "archiver"
24
+ ],
25
+ "author": "ayush24k",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/ayush24k/teleZipper.git"
29
+ },
30
+ "homepage": "https://github.com/ayush24k/teleZipper#readme",
17
31
  "license": "ISC",
18
32
  "dependencies": {
19
33
  "archiver": "^7.0.1",