torrent-tui 0.0.1 → 0.0.2

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
@@ -1,6 +1,6 @@
1
1
  # torrent-tui
2
2
 
3
- **A Bun-powered terminal BitTorrent client.** Add `.torrent` files, manage active downloads, and inspect transfer state from a focused TUI.
3
+ **A terminal BitTorrent client for focused download management.** Add `.torrent` files, track active transfers, and manage sessions from a clean keyboard-driven interface.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/torrent-tui?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/torrent-tui)
6
6
  [![CI](https://img.shields.io/github/actions/workflow/status/ryadios/torrent-tui/ci.yml?branch=main&style=for-the-badge&logo=github)](https://github.com/ryadios/torrent-tui/actions/workflows/ci.yml)
@@ -8,6 +8,8 @@
8
8
 
9
9
  [Install](#install) · [Quickstart](#quickstart) · [Commands](#commands) · [Configuration](#configuration) · [Development](#development)
10
10
 
11
+ ![torrent-tui terminal interface](./docs/screenshot.png)
12
+
11
13
  > [!NOTE]
12
14
  > `torrent-tui` currently requires [Bun](https://bun.sh). Standalone binaries are planned after the npm CLI release path is stable.
13
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "torrent-tui",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "A Bun-powered terminal BitTorrent client.",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
@@ -1,5 +1,4 @@
1
1
  export const APP_NAME = "torrent-tui";
2
- export const VERSION = "0.0.1";
3
2
 
4
3
  export const SIDEBAR_WIDTH = 20;
5
4
 
package/src/index.ts CHANGED
@@ -1,18 +1,23 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import { VERSION } from "./constants";
4
3
  import { getPeers } from "./torrent/get_peers";
5
4
 
6
5
  class CliExit extends Error {}
7
6
 
7
+ async function getVersion(): Promise<string> {
8
+ const pkg = await import("../package.json");
9
+ return pkg.default.version as string;
10
+ }
11
+
8
12
  function fail(msg: string): never {
9
13
  console.error(msg);
10
14
  process.exitCode = 1;
11
15
  throw new CliExit();
12
16
  }
13
17
 
14
- function printHelp(): void {
15
- console.log(`torrent-tui ${VERSION}
18
+ async function printHelp(): Promise<void> {
19
+ const version = await getVersion();
20
+ console.log(`torrent-tui ${version}
16
21
 
17
22
  Usage:
18
23
  torrent-tui Start the terminal UI
@@ -261,12 +266,12 @@ async function main() {
261
266
  const args = process.argv.slice(2);
262
267
 
263
268
  if (args.includes("--help") || args.includes("-h")) {
264
- printHelp();
269
+ await printHelp();
265
270
  return;
266
271
  }
267
272
 
268
273
  if (args.includes("--version") || args.includes("-v")) {
269
- console.log(VERSION);
274
+ console.log(await getVersion());
270
275
  return;
271
276
  }
272
277