torl-client
v1.3.2
Published
A minimal BitTorrent client for Node.js
Maintainers
Readme
Features
- Torrent files & magnet links — download from
.torrentfiles or resolvemagnet:links. - Tracker + DHT peer discovery — supports UDP and HTTP trackers plus Mainline DHT.
- Rarest-first piece selection — prioritizes the pieces that are least available in the swarm.
- Pause & resume — a
.torl.statefile stores progress; existing data is verified on restart. - NAT traversal — automatic UPnP IGD and NAT-PMP port mapping helpers.
- Interactive TUI — running
torlopens a dashboard where downloads can be added, monitored, paused, and resumed. - Multiple downloads — queue or run several torrents and magnet links concurrently.
- Fully tested — fast, deterministic mock tests for the peer wire protocol, trackers, DHT, and NAT.
Installation
Install or update to the latest published version from npm:
npm install --global torl-client@latestCheck the installed version with torl-cli --version.
Or clone and install locally:
git clone https://github.com/mibienpanjoe/torL.git
cd torL
npm installThe torl command opens the TUI; the underlying TUI binary (torl-tui) is downloaded automatically during npm install for your platform from the matching GitHub release. If a prebuilt binary is not available, it falls back to building from source when Go is installed.
TUI Usage
Running torl without arguments opens the interactive dashboard:
torlFrom there, paste a magnet link, type a .torrent path, or browse for a torrent file. Positional inputs remain available as a faster way to preload one or more downloads:
# preload a single torrent
torl debian-13.6.0-amd64-netinst.iso.torrent
# preload several inputs
torl a.torrent b.torrent "magnet:?xt=urn:btih:..."
# override the output directory
torl file.torrent -o ~/Downloads
# override the path to the downloader backend
torl file.torrent -torl-path ./bin/torl-cli.jsInside the TUI:
aopens a field for pasting a magnet link or entering a.torrentpath.fopens the integrated.torrentfile picker.ochanges the output directory for downloads added afterward.↑/↓select a torrent.ptoggles pause/resume for the selected torrent.qorCtrl+Cpauses all active downloads and exits.Esccloses the active input or picker without changing anything.- Downloaded progress is saved automatically; re-running the same torrent resumes where it left off.
CLI Usage
For scripts or headless environments, use torl-cli instead of the TUI.
torl-cli <torrent-file|magnet-link>... [options]Options
-o, --output <dir> Output directory (default: Downloads)
-c, --concurrency <n> Max simultaneous downloads (default: 1)
-q, --quiet Suppress progress output
-h, --help Show help
-v, --version Show versionExamples
Download a single torrent:
torl-cli debian-13.6.0-amd64-netinst.iso.torrentDownload from a magnet link:
torl-cli "magnet:?xt=urn:btih:...&dn=example"Download multiple torrents concurrently:
torl-cli a.torrent b.torrent "magnet:?xt=urn:btih:..." -c 3Output is written to a directory named after the torrent inside the output directory.
Development
Run the test suite:
npm testRun a single test file:
npm test -- tests/download.test.jsBuild the TUI binary from source:
npm run build-tuiContributing
See CONTRIBUTING.md for setup, conventions, and how to submit changes.
License
Acknowledgements
Built with bencode for torrent decoding and Bubble Tea for the TUI.
