winload-rust-bin 0.1.10-beta.1 → 0.1.11-rc.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 (4) hide show
  1. package/bin.js +9 -3
  2. package/index.js +20 -10
  3. package/package.json +7 -7
  4. package/readme.md +11 -7
package/bin.js CHANGED
@@ -1,10 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * @vincentzyuapps/winload CLI entry point
4
+ * 📦 winload npm CLI entry point.
5
5
  *
6
- * 定位当前平台的预编译二进制并透传所有参数执行。
7
- * 用户通过 `npx @vincentzyuapps/winload` 或全局安装后直接 `winload` 即可运行。
6
+ * 🚀 This launcher is shared by the Rust binary npm distribution.
7
+ * 🧭 Users can install it in three ways:
8
+ * - npm install -g @vincentzyuapps/winload
9
+ * - npm install -g winload-rust-bin
10
+ * - npm install -g @vincentzyuapps/winload --registry https://npm.pkg.github.com
11
+ *
12
+ * 🔎 It resolves the current platform package and forwards all CLI arguments to
13
+ * the precompiled Rust binary.
8
14
  */
9
15
 
10
16
  "use strict";
package/index.js CHANGED
@@ -1,10 +1,17 @@
1
1
  /**
2
- * @vincentzyuapps/winload binary path resolver
2
+ * 📦 winload npm binary path resolver.
3
3
  *
4
- * npm 安装时会根据 optionalDependencies 中各平台包的 os/cpu 字段,
5
- * 仅下载与当前平台匹配的那一个。此模块负责定位该平台包中的二进制。
4
+ * 🧭 The npm release is available as:
5
+ * - @vincentzyuapps/winload on npm
6
+ * - winload-rust-bin on npm
7
+ * - @vincentzyuapps/winload on GitHub Packages
6
8
  *
7
- * 原理同 esbuild / @biomejs/biome / turbo 等项目。
9
+ * 🧩 optionalDependencies use each platform package's os/cpu fields, so npm only
10
+ * installs the package matching the current machine. This module locates that
11
+ * platform package and returns the bundled Rust binary path.
12
+ *
13
+ * 🛠 This follows the same packaging pattern used by projects such as esbuild,
14
+ * @biomejs/biome, and turbo.
8
15
  */
9
16
 
10
17
  "use strict";
@@ -12,9 +19,9 @@
12
19
  const path = require("path");
13
20
 
14
21
  /**
15
- * 平台映射表
22
+ * 🗺 Platform package mapping.
16
23
  * key: `${process.platform}-${process.arch}`
17
- * value: npm 平台包名
24
+ * value: npm platform package name
18
25
  */
19
26
  const PLATFORMS = {
20
27
  "win32-x64": "@vincentzyuapps/winload-win32-x64",
@@ -26,9 +33,9 @@ const PLATFORMS = {
26
33
  };
27
34
 
28
35
  /**
29
- * 获取当前平台对应的 winload 二进制绝对路径
30
- * @returns {string} 二进制路径
31
- * @throws {Error} 不支持的平台 / 平台包未安装
36
+ * 🔎 Resolve the absolute path to the winload binary for the current platform.
37
+ * @returns {string} Binary path
38
+ * @throws {Error} Unsupported platform or missing platform package
32
39
  */
33
40
  function getBinaryPath() {
34
41
  const key = `${process.platform}-${process.arch}`;
@@ -50,7 +57,10 @@ function getBinaryPath() {
50
57
  } catch {
51
58
  throw new Error(
52
59
  `winload: platform package "${pkg}" not found\n` +
53
- `Try reinstalling: npm install @vincentzyuapps/winload\n` +
60
+ `Try reinstalling one of:\n` +
61
+ ` npm install @vincentzyuapps/winload\n` +
62
+ ` npm install winload-rust-bin\n` +
63
+ ` npm install @vincentzyuapps/winload --registry https://npm.pkg.github.com\n` +
54
64
  `Or download manually: https://github.com/VincentZyuApps/winload/releases`
55
65
  );
56
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "winload-rust-bin",
3
- "version": "0.1.10-beta.1",
3
+ "version": "0.1.11-rc.1",
4
4
  "description": "Network Load Monitor — nload-like TUI tool for Windows/Linux/macOS (prebuilt Rust binary)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,11 +33,11 @@
33
33
  "access": "public"
34
34
  },
35
35
  "optionalDependencies": {
36
- "@vincentzyuapps/winload-win32-x64": "0.1.10-beta.1",
37
- "@vincentzyuapps/winload-win32-arm64": "0.1.10-beta.1",
38
- "@vincentzyuapps/winload-linux-x64": "0.1.10-beta.1",
39
- "@vincentzyuapps/winload-linux-arm64": "0.1.10-beta.1",
40
- "@vincentzyuapps/winload-darwin-x64": "0.1.10-beta.1",
41
- "@vincentzyuapps/winload-darwin-arm64": "0.1.10-beta.1"
36
+ "@vincentzyuapps/winload-win32-x64": "0.1.11-rc.1",
37
+ "@vincentzyuapps/winload-win32-arm64": "0.1.11-rc.1",
38
+ "@vincentzyuapps/winload-linux-x64": "0.1.11-rc.1",
39
+ "@vincentzyuapps/winload-linux-arm64": "0.1.11-rc.1",
40
+ "@vincentzyuapps/winload-darwin-x64": "0.1.11-rc.1",
41
+ "@vincentzyuapps/winload-darwin-arm64": "0.1.11-rc.1"
42
42
  }
43
43
  }
package/readme.md CHANGED
@@ -60,9 +60,10 @@ https://github.com/rolandriegel/nload
60
60
  git clone https://github.com/VincentZyuApps/winload.git
61
61
  # or clone from Gitee (faster in China Mainland):
62
62
  # git clone https://gitee.com/vincent-zyu/winload.git
63
- cd winload/py
64
- pip install -r requirements.txt
65
- python main.py
63
+ cd winload/python
64
+ uv venv --python 3.13
65
+ uv pip install -r requirements.txt
66
+ uv run python main.py
66
67
  ```
67
68
 
68
69
  ### Rust
@@ -165,8 +166,10 @@ which winload
165
166
  ### macOS / Linux (Homebrew)
166
167
  > 📄 [Homebrew Formula (GitHub)](https://github.com/VincentZyuApps/homebrew-tap/blob/main/Formula/winload.rb)
167
168
  > 📄 [Homebrew Formula (Gitee)](https://gitee.com/vincent-zyu/homebrew-tap/blob/main/Formula/winload.rb)
169
+ > Recent Homebrew versions may require trusting third-party tap formulae before installation.
168
170
  ```bash
169
171
  brew tap vincentzyuapps/tap
172
+ brew trust vincentzyuapps/tap
170
173
  # or from Gitee (manual tap clone):
171
174
  # git clone https://gitee.com/vincent-zyu/homebrew-tap.git "$(brew --prefix)/Library/Taps/vincentzyuapps/homebrew-tap"
172
175
  brew update && brew install winload
@@ -208,7 +211,7 @@ winload --max-mode smart --max-half-life 10 # Smooth adaptive Y-axis (default)
208
211
  winload --max-mode legacy # nload-style visible-history scaling
209
212
  winload --max-mode fixed --max-y-value 10M # Fixed Y-axis max
210
213
  winload --npcap # Capture 127.0.0.1 loopback traffic (Windows, requires Npcap)
211
- winload --netlink # Manually enable RTNETLINK (Linux/Android Rust edition, off by default)
214
+ winload --netlink # Manually enable RTNETLINK (Linux/Android, off by default)
212
215
  ```
213
216
 
214
217
  ### Options
@@ -232,7 +235,7 @@ winload --netlink # Manually enable RTNETLINK (Linux/Android Rust edition, of
232
235
  | `--hide-separator` | Hide the separator line (row of equals signs) | off |
233
236
  | `--no-color` | Disable all TUI colors (monochrome mode) | off |
234
237
  | `--npcap` | **[Windows Rust Only]** Capture loopback traffic via Npcap (recommended) | off |
235
- | `--netlink` | **[Linux/Android Rust Only]** Use RTNETLINK instead of sysinfo (for Termux proot distro or restricted environments) | off |
238
+ | `--netlink` | **[Linux/Android Only]** Use RTNETLINK instead of the default backend (for Termux proot distro or restricted environments) | off |
236
239
  | `--debug-info` | Print network interface debug info and exit | — |
237
240
  | `-h`, `--help` | Print help (`--help --emoji` for emoji version!) | — |
238
241
  | `-V`, `--version` | Print version | — |
@@ -275,13 +278,13 @@ This requires [Npcap](https://npcap.com/#download) installed with "Support loopb
275
278
 
276
279
  On Linux and macOS, loopback traffic works out of the box — no extra flags needed.
277
280
 
278
- On **Linux/Android**, if `/proc/net/dev` is not accessible (e.g. inside a Termux proot distro or other restricted environments), the Rust edition can use `--netlink` to collect network stats via RTNETLINK directly:
281
+ On **Linux/Android**, if `/proc/net/dev` is not accessible (e.g. inside a Termux proot distro or other restricted environments), use `--netlink` to collect network stats via RTNETLINK directly:
279
282
 
280
283
  ```bash
281
284
  winload --netlink
282
285
  ```
283
286
 
284
- > Note: `--netlink` is an **opt-in backend**, similar to `--npcap`; it is never enabled unless you pass the flag. Normal Linux/Android runs still use sysinfo by default. This flag is **Linux/Android Rust edition only**; the Python edition does not support `--netlink` and continues to use psutil. macOS does not support netlink.
287
+ > Note: `--netlink` is an **opt-in backend**, similar to `--npcap`; it is never enabled unless you pass the flag. Normal Linux/Android runs still use the default backend (Rust: sysinfo, Python: psutil). The Python edition uses `pyroute2` for RTNETLINK on Linux/Android. macOS does not support netlink.
285
288
  >
286
289
  > 📖 For a deep dive into Linux/Android network statistics collection, see [docs/linux_android_netlink.md](docs/linux_android_netlink.md)
287
290
 
@@ -308,6 +311,7 @@ winload --netlink
308
311
  |:---|:---|:---|
309
312
  | [![Python](https://img.shields.io/badge/Python-3.13.11-3776AB?style=flat-square&logo=python&logoColor=white)](https://python.org/) | 3.13.11 | Programming language |
310
313
  | [![psutil](https://img.shields.io/badge/psutil-≥7.0-FFD43B?style=flat-square&logo=python&logoColor=white)](https://github.com/giampaolo/psutil) | ≥7.0 | Process and system utilities |
314
+ | [![pyroute2](https://img.shields.io/badge/pyroute2-≥0.9.6-FFD43B?style=flat-square&logo=python&logoColor=white)](https://github.com/svinota/pyroute2) | ≥0.9.6 | RTNETLINK backend on Linux/Android |
311
315
  | [![windows-curses](https://img.shields.io/badge/windows--curses-≥2.0-FFD43B?style=flat-square&logo=python&logoColor=white)](https://github.com/zhirui2020/windows-curses) | ≥2.0 | Windows curses support |
312
316
 
313
317
  ### Rust Edition