@mjahir/idm-cli
v1.0.0
Published
Multi-threaded download manager CLI — concurrent HTTP Range Request downloader with live progress bar
Maintainers
Readme
⚡ @mjahir/idm-cli
A multi-threaded download manager for the command line. Downloads files faster by splitting them into chunks and fetching them concurrently using HTTP Range Requests.
╔══════════════════════════════════════════╗
║ 🚀 IDM — Download Manager v1.0.0 ║
╚══════════════════════════════════════════╝Features
- 🚀 Multi-threaded downloads — splits files into N chunks, downloads in parallel
- 📊 Live progress bar — real-time percentage, speed, and ETA
- 🔄 Smart server probing — 3-tier fallback (HEAD → GET Range → single-stream)
- 📦 Auto file assembly — stitches chunks back together seamlessly
- 🧹 Auto cleanup — removes temp files after assembly
- 🌐 Wide compatibility — works with servers that reject HEAD requests (e.g. archive.org)
Installation
npm install -g @mjahir/idm-cliUsage
# Download with 4 threads (default)
idm <url>
# Download with custom thread count
idm <url> <threads>Examples
# Download a file with 4 concurrent connections
idm https://example.com/large-file.zip
# Download with 8 threads for faster speeds
idm https://example.com/large-file.zip 8
# Works with archive.org and other tricky servers
idm https://archive.org/compress/MyCollectionHow It Works
┌─────────────────────────────────────────────────┐
│ 1. PRE-FLIGHT HEAD request → file metadata │
│ 2. CHUNK CALC Split into N byte ranges │
│ 3. DOWNLOAD N concurrent Range requests │
│ 4. ASSEMBLE Stitch .tmp files in order │
│ 5. CLEANUP Delete temp files │
└─────────────────────────────────────────────────┘- Pre-flight — Sends a HEAD request (falls back to GET probe) to discover file size and Range support
- Chunk calculation — Divides the file into N equal byte ranges
- Concurrent download — Each chunk downloads in parallel via
Range: bytes=start-end - Assembly — Chunks are piped sequentially into the final file
- Cleanup — All
.tmpfiles are deleted
Fallback Mode
If the server doesn't support Range requests, IDM automatically falls back to a standard single-stream download — no configuration needed.
Sample Output
[11:42:27 pm] [INFO] ═══ PRE-FLIGHT PHASE ═══
[11:42:27 pm] [INFO] Sending HEAD request to: https://example.com/file.zip
[11:42:29 pm] [INFO] File size: 151.59 MB (158949668 bytes)
[11:42:29 pm] [SUCCESS] Server supports Range requests ✓
[11:42:29 pm] [INFO] ═══ DOWNLOAD PHASE ═══
[11:42:29 pm] [INFO] Launching 4 concurrent download workers...
██████████████████████████████ 100.0% 151.59 MB / 151.59 MB ⚡ 2.14 MB/s
[11:43:37 pm] [SUCCESS] All chunks downloaded successfully ✓
[11:43:37 pm] [INFO] ═══ ASSEMBLY PHASE ═══
[11:43:37 pm] [SUCCESS] Assembly complete: file.zip (151.59 MB)
╔══════════════════════════════════════════════════════════════╗
║ ✅ DOWNLOAD COMPLETE ║
╠══════════════════════════════════════════════════════════════╣
║ File: file.zip ║
║ Size: 151.59 MB ║
║ Threads: 4 ║
║ Time: 70.70s ║
║ Avg Speed: 2.14 MB/s ║
╚══════════════════════════════════════════════════════════════╝Requirements
- Node.js >= 16.0.0
License
MIT © mjahir
