about-system 0.0.35 → 0.0.37
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/dist/about-system-cli.js +1 -1
- package/dist/cpu-geekbench-1k.json +1 -0
- package/dist/index.js +1 -1
- package/dist/system-info-api-J8OqC6YU.js +2148 -0
- package/dist/system-info-api-J8OqC6YU.js.map +1 -0
- package/dist/system-info-api.d.ts +20 -0
- package/dist/system-info-api.js +1 -1
- package/package.json +2 -1
- package/src/info/hardware.ts +160 -0
- package/src/info/settings.ts +4 -1
- package/src/system-info-api.ts +5 -1
- package/src/systeminfo-types.d.ts +29 -2
- package/dist/system-info-api-DgOWhb9D.js +0 -837
- package/dist/system-info-api-DgOWhb9D.js.map +0 -1
|
@@ -10,6 +10,15 @@ import { SystemInfoOptions } from './systeminfo-types';
|
|
|
10
10
|
*/
|
|
11
11
|
declare function battery(context: InfoContext): string;
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Gets CPU benchmark score and rank from Geekbench 6 data
|
|
15
|
+
* Uses fuzzy matching to find similar CPU models
|
|
16
|
+
* @param context - Info context with cache
|
|
17
|
+
* @returns Benchmark info with score and rank, or empty string
|
|
18
|
+
* @example "💪 37.9k #1", "💪 20.5k #68"
|
|
19
|
+
*/
|
|
20
|
+
declare function bench(context: InfoContext): string;
|
|
21
|
+
|
|
13
22
|
/**
|
|
14
23
|
* Cache storage structure
|
|
15
24
|
* @interface Cache
|
|
@@ -75,6 +84,15 @@ declare function containers(context: InfoContext): string;
|
|
|
75
84
|
*/
|
|
76
85
|
declare function cpu(context: InfoContext): string;
|
|
77
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Gets detailed CPU benchmark information from Geekbench 6 data
|
|
89
|
+
* Includes score, rank, and architecture type (ARM/Intel/AMD)
|
|
90
|
+
* @param context - Info context with cache
|
|
91
|
+
* @returns Detailed benchmark info with architecture, or empty string
|
|
92
|
+
* @example "Geekbench 6: 37.9k (Rank #1) - ARM", "Geekbench 6: 20.5k (Rank #68) - Intel"
|
|
93
|
+
*/
|
|
94
|
+
declare function cpu_bench_info(context: InfoContext): string;
|
|
95
|
+
|
|
78
96
|
/**
|
|
79
97
|
* Gets device or computer model name
|
|
80
98
|
* Uses WMI on Windows, DMI on Linux, getprop on Android
|
|
@@ -147,6 +165,8 @@ export declare const infoFunctions: {
|
|
|
147
165
|
os: typeof os_info;
|
|
148
166
|
cpu: typeof cpu;
|
|
149
167
|
gpu: typeof gpu;
|
|
168
|
+
bench: typeof bench;
|
|
169
|
+
cpu_bench_info: typeof cpu_bench_info;
|
|
150
170
|
disk_used: typeof disk_used;
|
|
151
171
|
ram_used: typeof ram_used;
|
|
152
172
|
top_process: typeof top_process;
|
package/dist/system-info-api.js
CHANGED
|
@@ -2,7 +2,7 @@ import "os";
|
|
|
2
2
|
import "fs";
|
|
3
3
|
import "https";
|
|
4
4
|
import "path";
|
|
5
|
-
import { g as m, i as r, l as p, s as n } from "./system-info-api-
|
|
5
|
+
import { g as m, i as r, l as p, s as n } from "./system-info-api-J8OqC6YU.js";
|
|
6
6
|
export {
|
|
7
7
|
m as getSystemInfo,
|
|
8
8
|
r as infoFunctions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "about-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"description": "A Node.js script to display key system information with emojis. Cross-platform support for Windows, macOS, and Linux with customizable output and caching.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"bin": "."
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
+
"fuse.js": "^7.0.0",
|
|
79
80
|
"ora": "^9.0.0"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
package/src/info/hardware.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { InfoContext } from "../types/internal-types";
|
|
|
9
9
|
import { IS_WINDOWS, IS_LINUX } from "../utils/platform";
|
|
10
10
|
import { execCommand } from "../utils/command";
|
|
11
11
|
import { getCachedValue, setCachedValue } from "../cache/cache";
|
|
12
|
+
import Fuse from "fuse.js";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Gets CPU model name and specifications
|
|
@@ -171,3 +172,162 @@ export function screen_resolution(): string {
|
|
|
171
172
|
} catch {}
|
|
172
173
|
return "";
|
|
173
174
|
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Gets CPU benchmark score and rank from Geekbench 6 data
|
|
178
|
+
* Uses fuzzy matching to find similar CPU models
|
|
179
|
+
* @param context - Info context with cache
|
|
180
|
+
* @returns Benchmark info with score and rank, or empty string
|
|
181
|
+
* @example "💪 37.9k #1", "💪 20.5k #68"
|
|
182
|
+
*/
|
|
183
|
+
export function bench(context: InfoContext): string {
|
|
184
|
+
const cached = getCachedValue(context.cache, "bench");
|
|
185
|
+
if (cached) return cached;
|
|
186
|
+
|
|
187
|
+
const cpuName = cpu(context);
|
|
188
|
+
if (!cpuName) {
|
|
189
|
+
setCachedValue(context.cache, "bench", "");
|
|
190
|
+
return "";
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
let benchmarkPath: string;
|
|
195
|
+
const benchmarkFile = "cpu-geekbench-1k.json";
|
|
196
|
+
|
|
197
|
+
// Try multiple resolution strategies
|
|
198
|
+
if (fs.existsSync(benchmarkFile)) {
|
|
199
|
+
benchmarkPath = benchmarkFile;
|
|
200
|
+
} else if (fs.existsSync(`src/bench/${benchmarkFile}`)) {
|
|
201
|
+
benchmarkPath = `src/bench/${benchmarkFile}`;
|
|
202
|
+
} else if (fs.existsSync(`./bench/${benchmarkFile}`)) {
|
|
203
|
+
benchmarkPath = `./bench/${benchmarkFile}`;
|
|
204
|
+
} else {
|
|
205
|
+
// Last resort: construct path from import.meta.url
|
|
206
|
+
try {
|
|
207
|
+
const url = new URL(`./${benchmarkFile}`, import.meta.url);
|
|
208
|
+
benchmarkPath = url.pathname;
|
|
209
|
+
if (!fs.existsSync(benchmarkPath)) {
|
|
210
|
+
const distPath = url.pathname.substring(0, url.pathname.lastIndexOf('/'));
|
|
211
|
+
benchmarkPath = distPath + `/${benchmarkFile}`;
|
|
212
|
+
}
|
|
213
|
+
} catch {
|
|
214
|
+
benchmarkPath = benchmarkFile;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const benchmarkData = fs.readFileSync(benchmarkPath, "utf8");
|
|
219
|
+
const parsed = JSON.parse(benchmarkData);
|
|
220
|
+
const scores = parsed.scores as [string, number, number][];
|
|
221
|
+
|
|
222
|
+
const cpuList = scores.map((item) => ({ name: item[0], score: item[1], rank: item[2] }));
|
|
223
|
+
|
|
224
|
+
const fuse = new Fuse(cpuList, {
|
|
225
|
+
keys: ["name"],
|
|
226
|
+
threshold: 0.6,
|
|
227
|
+
minMatchCharLength: 3,
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
const results = fuse.search(cpuName);
|
|
231
|
+
if (results.length > 0) {
|
|
232
|
+
const match = results[0].item;
|
|
233
|
+
const score = Math.round(match.score / 100) / 10;
|
|
234
|
+
const rank = match.rank;
|
|
235
|
+
const result = `💪 ${score}k #${rank}`;
|
|
236
|
+
setCachedValue(context.cache, "bench", result);
|
|
237
|
+
return result;
|
|
238
|
+
}
|
|
239
|
+
} catch (e) {
|
|
240
|
+
// Silently fail
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
setCachedValue(context.cache, "bench", "");
|
|
244
|
+
return "";
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Gets detailed CPU benchmark information from Geekbench 6 data
|
|
249
|
+
* Includes score, rank, and architecture type (ARM/Intel/AMD)
|
|
250
|
+
* @param context - Info context with cache
|
|
251
|
+
* @returns Detailed benchmark info with architecture, or empty string
|
|
252
|
+
* @example "Geekbench 6: 37.9k (Rank #1) - ARM", "Geekbench 6: 20.5k (Rank #68) - Intel"
|
|
253
|
+
*/
|
|
254
|
+
export function cpu_bench_info(context: InfoContext): string {
|
|
255
|
+
const cached = getCachedValue(context.cache, "cpu_bench_info");
|
|
256
|
+
if (cached) return cached;
|
|
257
|
+
|
|
258
|
+
const cpuName = cpu(context);
|
|
259
|
+
if (!cpuName) {
|
|
260
|
+
setCachedValue(context.cache, "cpu_bench_info", "");
|
|
261
|
+
return "";
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
try {
|
|
265
|
+
let benchmarkPath: string;
|
|
266
|
+
const benchmarkFile = "cpu-geekbench-1k.json";
|
|
267
|
+
|
|
268
|
+
// Try multiple resolution strategies
|
|
269
|
+
if (fs.existsSync(benchmarkFile)) {
|
|
270
|
+
benchmarkPath = benchmarkFile;
|
|
271
|
+
} else if (fs.existsSync(`src/bench/${benchmarkFile}`)) {
|
|
272
|
+
benchmarkPath = `src/bench/${benchmarkFile}`;
|
|
273
|
+
} else if (fs.existsSync(`./bench/${benchmarkFile}`)) {
|
|
274
|
+
benchmarkPath = `./bench/${benchmarkFile}`;
|
|
275
|
+
} else {
|
|
276
|
+
// Last resort: construct path from import.meta.url
|
|
277
|
+
try {
|
|
278
|
+
const url = new URL(`./${benchmarkFile}`, import.meta.url);
|
|
279
|
+
benchmarkPath = url.pathname;
|
|
280
|
+
if (!fs.existsSync(benchmarkPath)) {
|
|
281
|
+
const distPath = url.pathname.substring(0, url.pathname.lastIndexOf('/'));
|
|
282
|
+
benchmarkPath = distPath + `/${benchmarkFile}`;
|
|
283
|
+
}
|
|
284
|
+
} catch {
|
|
285
|
+
benchmarkPath = benchmarkFile;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const benchmarkData = fs.readFileSync(benchmarkPath, "utf8");
|
|
290
|
+
const parsed = JSON.parse(benchmarkData);
|
|
291
|
+
const scores = parsed.scores as [string, number, number][];
|
|
292
|
+
|
|
293
|
+
const cpuList = scores.map((item) => ({
|
|
294
|
+
name: item[0],
|
|
295
|
+
score: item[1],
|
|
296
|
+
rank: item[2],
|
|
297
|
+
}));
|
|
298
|
+
|
|
299
|
+
const fuse = new Fuse(cpuList, {
|
|
300
|
+
keys: ["name"],
|
|
301
|
+
threshold: 0.6,
|
|
302
|
+
minMatchCharLength: 3,
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
const results = fuse.search(cpuName);
|
|
306
|
+
if (results.length > 0) {
|
|
307
|
+
const match = results[0].item;
|
|
308
|
+
const score = Math.round(match.score / 100) / 10;
|
|
309
|
+
const rank = match.rank;
|
|
310
|
+
|
|
311
|
+
// Detect architecture type
|
|
312
|
+
let arch = "Unknown";
|
|
313
|
+
if (match.name.includes("Apple") || match.name.includes("ARM")) {
|
|
314
|
+
arch = "ARM";
|
|
315
|
+
} else if (match.name.includes("Intel")) {
|
|
316
|
+
arch = "Intel";
|
|
317
|
+
} else if (match.name.includes("AMD") || match.name.includes("Ryzen") || match.name.includes("EPYC")) {
|
|
318
|
+
arch = "AMD";
|
|
319
|
+
} else if (match.name.includes("Qualcomm")) {
|
|
320
|
+
arch = "ARM";
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const result = `Geekbench 6: ${score}k (Rank #${rank}) - ${arch}`;
|
|
324
|
+
setCachedValue(context.cache, "cpu_bench_info", result);
|
|
325
|
+
return result;
|
|
326
|
+
}
|
|
327
|
+
} catch (e) {
|
|
328
|
+
// Silently fail
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
setCachedValue(context.cache, "cpu_bench_info", "");
|
|
332
|
+
return "";
|
|
333
|
+
}
|
package/src/info/settings.ts
CHANGED
|
@@ -34,7 +34,7 @@ export const colors = {
|
|
|
34
34
|
// Default settings
|
|
35
35
|
export const DEFAULT_SETTINGS = {
|
|
36
36
|
display_order: [
|
|
37
|
-
["user", "hostname", "os", "device", "kernel", "cpu", "gpu"],
|
|
37
|
+
["user", "hostname", "os", "device", "kernel", "cpu", "gpu", "bench"],
|
|
38
38
|
[
|
|
39
39
|
"disk_used",
|
|
40
40
|
"ram_used",
|
|
@@ -62,6 +62,7 @@ export const DEFAULT_SETTINGS = {
|
|
|
62
62
|
os: "gray",
|
|
63
63
|
cpu: "orange",
|
|
64
64
|
gpu: "yellow",
|
|
65
|
+
bench: "red",
|
|
65
66
|
device: "yellow",
|
|
66
67
|
kernel: "green",
|
|
67
68
|
shell: "orange",
|
|
@@ -90,6 +91,7 @@ export const DEFAULT_SETTINGS = {
|
|
|
90
91
|
os: "⚡ ",
|
|
91
92
|
cpu: "📈 ",
|
|
92
93
|
gpu: "🎮 ",
|
|
94
|
+
bench: "💪 ",
|
|
93
95
|
device: "💻 ",
|
|
94
96
|
kernel: "🔧 ",
|
|
95
97
|
shell: "🐚 ",
|
|
@@ -123,6 +125,7 @@ export const DEFAULT_SETTINGS = {
|
|
|
123
125
|
os: "OS",
|
|
124
126
|
cpu: "CPU",
|
|
125
127
|
gpu: "GPU",
|
|
128
|
+
bench: "Bench",
|
|
126
129
|
device: "Device",
|
|
127
130
|
kernel: "Kernel",
|
|
128
131
|
shell: "Shell",
|
package/src/system-info-api.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { CACHE_FILE } from "./info/settings"; // Using CACHE_FILE from settings
|
|
|
18
18
|
|
|
19
19
|
// Import info functions from modules
|
|
20
20
|
import { user, hostname, os_info, kernel, device } from "./info/platform";
|
|
21
|
-
import { cpu, gpu, screen_resolution } from "./info/hardware";
|
|
21
|
+
import { cpu, gpu, screen_resolution, bench, cpu_bench_info } from "./info/hardware";
|
|
22
22
|
import {
|
|
23
23
|
disk_used,
|
|
24
24
|
ram_used,
|
|
@@ -52,6 +52,8 @@ const CACHE_DURATION = {
|
|
|
52
52
|
ip: 5 * 60 * 1000,
|
|
53
53
|
cpu: 24 * 60 * 60 * 1000,
|
|
54
54
|
gpu: 24 * 60 * 60 * 1000,
|
|
55
|
+
bench: 24 * 60 * 60 * 1000,
|
|
56
|
+
cpu_bench_info: 24 * 60 * 60 * 1000,
|
|
55
57
|
os: 24 * 60 * 60 * 1000,
|
|
56
58
|
device: 24 * 60 * 60 * 1000,
|
|
57
59
|
kernel: 60 * 60 * 1000,
|
|
@@ -191,6 +193,8 @@ export const infoFunctions = {
|
|
|
191
193
|
os: os_info, // Mapped from os_info
|
|
192
194
|
cpu,
|
|
193
195
|
gpu,
|
|
196
|
+
bench,
|
|
197
|
+
cpu_bench_info,
|
|
194
198
|
disk_used,
|
|
195
199
|
ram_used,
|
|
196
200
|
top_process,
|
|
@@ -113,14 +113,41 @@ export interface SystemInfo {
|
|
|
113
113
|
* Primary GPU identification (Linux systems primarily)
|
|
114
114
|
* Extracted from lspci output when available
|
|
115
115
|
* Empty string if no discrete GPU or detection fails
|
|
116
|
-
*
|
|
116
|
+
*
|
|
117
117
|
* @example
|
|
118
118
|
* - "NVIDIA GeForce RTX 4070"
|
|
119
|
-
* - "AMD Radeon RX 6800 XT"
|
|
119
|
+
* - "AMD Radeon RX 6800 XT"
|
|
120
120
|
* - "Intel UHD Graphics 770"
|
|
121
121
|
*/
|
|
122
122
|
gpu: string;
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* CPU benchmark score from Geekbench 6 multi-core
|
|
126
|
+
* Shows performance score (in thousands) and ranking position
|
|
127
|
+
* Uses fuzzy matching to find similar CPU models from top 1000 list
|
|
128
|
+
* Empty string if CPU not found or benchmark data unavailable
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* - "💪 37.9k #1" (top performing CPU)
|
|
132
|
+
* - "💪 20.5k #68" (mid-range CPU)
|
|
133
|
+
* - "" (CPU not in benchmark database)
|
|
134
|
+
*/
|
|
135
|
+
bench: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Detailed CPU benchmark information from Geekbench 6 multi-core
|
|
139
|
+
* Shows score, rank, and architecture type (ARM/Intel/AMD)
|
|
140
|
+
* Uses fuzzy matching to find similar CPU models
|
|
141
|
+
* Empty string if CPU not found or benchmark data unavailable
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* - "Geekbench 6: 37.9k (Rank #1) - ARM" (Apple M4 Ultra)
|
|
145
|
+
* - "Geekbench 6: 20.5k (Rank #68) - Intel" (Intel Core i9)
|
|
146
|
+
* - "Geekbench 6: 19.2k (Rank #91) - AMD" (AMD Ryzen 9 7950X)
|
|
147
|
+
* - "" (CPU not in benchmark database)
|
|
148
|
+
*/
|
|
149
|
+
cpu_bench_info: string;
|
|
150
|
+
|
|
124
151
|
/**
|
|
125
152
|
* Device or computer model name
|
|
126
153
|
* Hardware model identification when available
|