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.
- package/bin.js +9 -3
- package/index.js +20 -10
- package/package.json +7 -7
- package/readme.md +11 -7
package/bin.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* 📦 winload npm CLI entry point.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
-
*
|
|
2
|
+
* 📦 winload npm binary path resolver.
|
|
3
3
|
*
|
|
4
|
-
* npm
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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.
|
|
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.
|
|
37
|
-
"@vincentzyuapps/winload-win32-arm64": "0.1.
|
|
38
|
-
"@vincentzyuapps/winload-linux-x64": "0.1.
|
|
39
|
-
"@vincentzyuapps/winload-linux-arm64": "0.1.
|
|
40
|
-
"@vincentzyuapps/winload-darwin-x64": "0.1.
|
|
41
|
-
"@vincentzyuapps/winload-darwin-arm64": "0.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/
|
|
64
|
-
|
|
65
|
-
|
|
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
|
|
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
|
|
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),
|
|
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
|
|
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
|
| [](https://python.org/) | 3.13.11 | Programming language |
|
|
310
313
|
| [](https://github.com/giampaolo/psutil) | ≥7.0 | Process and system utilities |
|
|
314
|
+
| [](https://github.com/svinota/pyroute2) | ≥0.9.6 | RTNETLINK backend on Linux/Android |
|
|
311
315
|
| [](https://github.com/zhirui2020/windows-curses) | ≥2.0 | Windows curses support |
|
|
312
316
|
|
|
313
317
|
### Rust Edition
|