about-system 0.10.9 → 0.10.10
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.d.ts.map +1 -0
- package/dist/about-system-cli.js +1 -1
- package/dist/cache/cache-config.d.ts +62 -0
- package/dist/cache/cache-config.d.ts.map +1 -0
- package/dist/cache/cache.d.ts +53 -0
- package/dist/cache/cache.d.ts.map +1 -0
- package/dist/index.d.ts +18 -52
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/info/hardware.d.ts +76 -0
- package/dist/info/hardware.d.ts.map +1 -0
- package/dist/info/memory.d.ts +59 -0
- package/dist/info/memory.d.ts.map +1 -0
- package/dist/info/network.d.ts +54 -0
- package/dist/info/network.d.ts.map +1 -0
- package/dist/info/platform.d.ts +36 -0
- package/dist/info/platform.d.ts.map +1 -0
- package/dist/info/process.d.ts +23 -0
- package/dist/info/process.d.ts.map +1 -0
- package/dist/info/settings.d.ts +185 -0
- package/dist/info/settings.d.ts.map +1 -0
- package/dist/info/software.d.ts +33 -0
- package/dist/info/software.d.ts.map +1 -0
- package/dist/info/system-status.d.ts +36 -0
- package/dist/info/system-status.d.ts.map +1 -0
- package/dist/{system-info-api-NgTm8Gzo.js → system-info-api-ByXoHI0m.js} +314 -278
- package/dist/system-info-api-ByXoHI0m.js.map +1 -0
- package/dist/system-info-api.d.ts +62 -442
- package/dist/system-info-api.d.ts.map +1 -0
- package/dist/system-info-api.js +4 -5
- package/dist/system-info-api.js.map +1 -1
- package/dist/types/internal-types.d.ts +14 -0
- package/dist/types/internal-types.d.ts.map +1 -0
- package/dist/utils/command.d.ts +18 -0
- package/dist/utils/command.d.ts.map +1 -0
- package/dist/utils/network.d.ts +27 -0
- package/dist/utils/network.d.ts.map +1 -0
- package/dist/utils/platform.d.ts +11 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/web-server.d.ts +21 -0
- package/dist/web-server.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/cache/cache-config.ts +2 -2
- package/src/system-info-api.ts +2 -67
- package/src/utils/network.ts +104 -4
- package/src/utils/utils.test.ts +105 -38
- package/dist/system-info-api-NgTm8Gzo.js.map +0 -1
- package/dist/web/assets/index--HOsj3jw.js +0 -14
- package/dist/web/assets/index-BU_blZyu.css +0 -1
- package/dist/web/index.html +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"about-system-cli.d.ts","sourceRoot":"","sources":["../src/about-system-cli.ts"],"names":[],"mappings":";AAoJA,iBAAe,iBAAiB,CAC9B,kBAAkB,GAAE,MAAM,EAAE,EAAE,GAAG,IAAW,GAC3C,OAAO,CAAC,IAAI,CAAC,CAqDf;AA8ED,iBAAS,oBAAoB,IAAI,IAAI,CAoGpC;AAoJD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/about-system-cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import S from "os";
|
|
|
3
3
|
import c from "fs";
|
|
4
4
|
import u from "path";
|
|
5
5
|
import { fileURLToPath as O } from "url";
|
|
6
|
-
import { g as $, a as T, b, C as j, S as k, c as g, d as B, D as I } from "./system-info-api-
|
|
6
|
+
import { g as $, a as T, b, C as j, S as k, c as g, d as B, D as I } from "./system-info-api-ByXoHI0m.js";
|
|
7
7
|
import A from "http";
|
|
8
8
|
const C = 3777, _ = "127.0.0.1", w = {
|
|
9
9
|
".html": "text/html; charset=utf-8",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache configuration and constants
|
|
3
|
+
* @module cache-config
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Cache file location in system's temporary directory
|
|
7
|
+
* @constant
|
|
8
|
+
*/
|
|
9
|
+
export declare const CACHE_FILE: string;
|
|
10
|
+
/**
|
|
11
|
+
* Cache duration configuration for different system information types
|
|
12
|
+
* Values are in milliseconds
|
|
13
|
+
*
|
|
14
|
+
* @constant
|
|
15
|
+
* @property {number} ip - IP information cache (10 minutes)
|
|
16
|
+
* @property {number} cpu - CPU information cache (24 hours)
|
|
17
|
+
* @property {number} gpu - GPU information cache (24 hours)
|
|
18
|
+
* @property {number} os - OS information cache (24 hours)
|
|
19
|
+
* @property {number} device - Device information cache (24 hours)
|
|
20
|
+
* @property {number} kernel - Kernel information cache (1 hour)
|
|
21
|
+
* @property {number} pacman - Package managers cache (10 minutes)
|
|
22
|
+
* @property {number} ports - Open ports cache (5 minutes)
|
|
23
|
+
* @property {number} containers - Docker containers cache (5 minutes)
|
|
24
|
+
* @property {number} top_process - Top process cache (5 seconds)
|
|
25
|
+
* @property {number} disk_used - Disk usage cache (1 minute)
|
|
26
|
+
* @property {number} ram_used - RAM usage cache (10 seconds)
|
|
27
|
+
* @property {number} services_running - Services cache (5 minutes)
|
|
28
|
+
* @property {number} temperature - Temperature cache (30 seconds)
|
|
29
|
+
* @property {number} battery - Battery status cache (1 minute)
|
|
30
|
+
* @property {number} network_interfaces - Network interfaces cache (5 minutes)
|
|
31
|
+
* @property {number} mount_points - Mount points cache (10 minutes)
|
|
32
|
+
*/
|
|
33
|
+
export declare const CACHE_DURATION: {
|
|
34
|
+
ip: number;
|
|
35
|
+
cpu: number;
|
|
36
|
+
gpu: number;
|
|
37
|
+
os: number;
|
|
38
|
+
device: number;
|
|
39
|
+
kernel: number;
|
|
40
|
+
pacman: number;
|
|
41
|
+
ports: number;
|
|
42
|
+
containers: number;
|
|
43
|
+
top_process: number;
|
|
44
|
+
disk_used: number;
|
|
45
|
+
ram_used: number;
|
|
46
|
+
services_running: number;
|
|
47
|
+
temperature: number;
|
|
48
|
+
battery: number;
|
|
49
|
+
network_interfaces: number;
|
|
50
|
+
mount_points: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Default IPInfo.io API token for geolocation
|
|
54
|
+
* @constant
|
|
55
|
+
*/
|
|
56
|
+
export declare const DEFAULT_IPINFO_TOKEN = "da2d6cc4baa5d1";
|
|
57
|
+
/**
|
|
58
|
+
* Default network request timeout in milliseconds
|
|
59
|
+
* @constant
|
|
60
|
+
*/
|
|
61
|
+
export declare const DEFAULT_NETWORK_TIMEOUT = 5000;
|
|
62
|
+
//# sourceMappingURL=cache-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-config.d.ts","sourceRoot":"","sources":["../../src/cache/cache-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAkD,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;CAkB1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache management utilities
|
|
3
|
+
* @module cache
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents a cached value with timestamp
|
|
7
|
+
* @interface CacheEntry
|
|
8
|
+
*/
|
|
9
|
+
export interface CacheEntry {
|
|
10
|
+
/** The cached value */
|
|
11
|
+
value: any;
|
|
12
|
+
/** Unix timestamp when the value was cached */
|
|
13
|
+
timestamp: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Cache storage structure
|
|
17
|
+
* @interface Cache
|
|
18
|
+
*/
|
|
19
|
+
export interface Cache {
|
|
20
|
+
[key: string]: CacheEntry;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Loads cache from disk
|
|
24
|
+
* @returns {Cache} Cached data or empty object if cache doesn't exist or is corrupted
|
|
25
|
+
*/
|
|
26
|
+
export declare function loadCache(): Cache;
|
|
27
|
+
/**
|
|
28
|
+
* Saves cache to disk
|
|
29
|
+
* @param {Cache} cache - Cache object to save
|
|
30
|
+
*/
|
|
31
|
+
export declare function saveCache(cache: Cache): void;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if a cache entry is still valid based on configured duration
|
|
34
|
+
* @param {CacheEntry} cacheEntry - The cache entry to validate
|
|
35
|
+
* @param {string} key - The key name to determine cache duration
|
|
36
|
+
* @returns {boolean} True if cache is still valid
|
|
37
|
+
*/
|
|
38
|
+
export declare function isCacheValid(cacheEntry: CacheEntry, key: string): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves a value from cache if valid
|
|
41
|
+
* @param {Cache} cache - Cache object
|
|
42
|
+
* @param {string} key - Key to retrieve
|
|
43
|
+
* @returns {any} Cached value or null if not found/expired
|
|
44
|
+
*/
|
|
45
|
+
export declare function getCachedValue(cache: Cache, key: string): any;
|
|
46
|
+
/**
|
|
47
|
+
* Stores a value in cache with current timestamp
|
|
48
|
+
* @param {Cache} cache - Cache object
|
|
49
|
+
* @param {string} key - Key to store under
|
|
50
|
+
* @param {any} value - Value to cache
|
|
51
|
+
*/
|
|
52
|
+
export declare function setCachedValue(cache: Cache, key: string, value: any): void;
|
|
53
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/cache/cache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,uBAAuB;IACvB,KAAK,EAAE,GAAG,CAAC;IACX,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,KAAK,CASjC;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAM5C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAKzE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,CAQ7D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAK1E"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,52 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*/
|
|
20
|
-
declare interface CacheEntry {
|
|
21
|
-
value: any;
|
|
22
|
-
timestamp: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { DisplaySystemInfoFunction }
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Get all system information as a clean JSON object
|
|
29
|
-
*/
|
|
30
|
-
export declare function getSystemInfo(options?: SystemInfoOptions_2): Promise<SystemInfo_2>;
|
|
31
|
-
|
|
32
|
-
export { GetSystemInfoFunction }
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Loads cache from disk
|
|
36
|
-
*/
|
|
37
|
-
export declare function loadCache(): Cache;
|
|
38
|
-
|
|
39
|
-
export { Platform }
|
|
40
|
-
|
|
41
|
-
export { PlatformAvailability }
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Saves cache to disk
|
|
45
|
-
*/
|
|
46
|
-
export declare function saveCache(cache: Cache): void;
|
|
47
|
-
|
|
48
|
-
export { SystemInfo }
|
|
49
|
-
|
|
50
|
-
export { SystemInfoOptions }
|
|
51
|
-
|
|
52
|
-
export { }
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Main entry point for about-system package
|
|
3
|
+
*
|
|
4
|
+
* Exports the system information API for programmatic use.
|
|
5
|
+
* For CLI usage, use the 'about-system' command directly.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { getSystemInfo } from 'about-system';
|
|
10
|
+
*
|
|
11
|
+
* const info = await getSystemInfo();
|
|
12
|
+
* console.log(info.cpu);
|
|
13
|
+
* console.log(info.ram_used);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export { getSystemInfo, loadCache, saveCache } from './system-info-api.js';
|
|
17
|
+
export type { SystemInfo, SystemInfoOptions, Platform, GetSystemInfoFunction, DisplaySystemInfoFunction, PlatformAvailability } from './systeminfo-types.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3E,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { InfoContext } from '../types/internal-types';
|
|
2
|
+
/**
|
|
3
|
+
* Formats a Geekbench score in whole thousands with its rank and how far up
|
|
4
|
+
* the table that rank sits.
|
|
5
|
+
* @param score - Raw Geekbench score
|
|
6
|
+
* @param rank - Rank in the benchmark table (1 = fastest)
|
|
7
|
+
* @param total - Number of entries in the benchmark table
|
|
8
|
+
* @returns Score, rank and top percentile
|
|
9
|
+
* @example formatBench(20512, 68, 1500) // "21k #68 top 7%"
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatBench(score: number, rank: number, total: number): string;
|
|
12
|
+
/**
|
|
13
|
+
* Percentile bucket a rank falls in, rounded up so rank 1 reads "top 1%"
|
|
14
|
+
* @param rank - Rank in the benchmark table (1 = fastest)
|
|
15
|
+
* @param total - Number of entries in the benchmark table
|
|
16
|
+
* @returns Whole percentage between 1 and 100
|
|
17
|
+
*/
|
|
18
|
+
export declare function topPercent(rank: number, total: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* Gets CPU model name and specifications
|
|
21
|
+
* Uses platform-specific commands (wmic/lscpu/cpuinfo)
|
|
22
|
+
* Automatically strips "with Radeon Graphics" and similar suffixes
|
|
23
|
+
* @param context - Info context with cache
|
|
24
|
+
* @returns CPU model string or empty string
|
|
25
|
+
* @example "Intel Core i7-12700K", "AMD Ryzen 9 5900HX", "Apple M2 Pro"
|
|
26
|
+
*/
|
|
27
|
+
export declare function cpu(context: InfoContext): string;
|
|
28
|
+
/**
|
|
29
|
+
* Gets graphics card model name
|
|
30
|
+
* Extracts GPU info from lspci (Linux) or WMI (Windows)
|
|
31
|
+
* Filters out basic/generic display adapters
|
|
32
|
+
* @param context - Info context with cache
|
|
33
|
+
* @returns GPU model string or empty string
|
|
34
|
+
* @example "NVIDIA GeForce RTX 4070", "AMD Radeon RX 6800 XT"
|
|
35
|
+
*/
|
|
36
|
+
export declare function gpu(context: InfoContext): string;
|
|
37
|
+
/**
|
|
38
|
+
* Gets screen resolution
|
|
39
|
+
* Uses xrandr on Linux (X11/Xorg only) or system_profiler on macOS
|
|
40
|
+
* @returns Resolution in WIDTHxHEIGHT format or empty string
|
|
41
|
+
* @example "1920x1080", "2560x1440", "3840x2160"
|
|
42
|
+
*/
|
|
43
|
+
export declare function screen_resolution(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Gets CPU benchmark score and rank from Geekbench 6 data
|
|
46
|
+
* Uses fuzzy matching to find similar CPU models
|
|
47
|
+
* @param context - Info context with cache
|
|
48
|
+
* @returns Benchmark info with score and rank, or empty string
|
|
49
|
+
* @example "38k #1 top 1%", "21k #68 top 7%"
|
|
50
|
+
*/
|
|
51
|
+
export declare function bench(context: InfoContext): string;
|
|
52
|
+
/**
|
|
53
|
+
* Gets detailed CPU benchmark information from Geekbench 6 data
|
|
54
|
+
* Includes score, rank, and architecture type (ARM/Intel/AMD)
|
|
55
|
+
* @param context - Info context with cache
|
|
56
|
+
* @returns Detailed benchmark info with architecture, or empty string
|
|
57
|
+
* @example "Geekbench 6: 38k (Rank #1, top 1%) - ARM", "Geekbench 6: 21k (Rank #68, top 7%) - Intel"
|
|
58
|
+
*/
|
|
59
|
+
export declare function cpu_bench_info(context: InfoContext): string;
|
|
60
|
+
/**
|
|
61
|
+
* Gets GPU benchmark score and rank from Geekbench 6 data
|
|
62
|
+
* Uses fuzzy matching to find similar GPU models
|
|
63
|
+
* @param context - Info context with cache
|
|
64
|
+
* @returns Benchmark info with score and rank, or empty string
|
|
65
|
+
* @example "38k #1 top 1%", "21k #68 top 7%"
|
|
66
|
+
*/
|
|
67
|
+
export declare function gpu_bench(context: InfoContext): string;
|
|
68
|
+
/**
|
|
69
|
+
* Gets detailed GPU benchmark information from Geekbench 6 data
|
|
70
|
+
* Includes score, rank, and vendor detection
|
|
71
|
+
* @param context - Info context with cache
|
|
72
|
+
* @returns Detailed benchmark info with vendor, or empty string
|
|
73
|
+
* @example "Geekbench 6: 38k (Rank #1, top 1%) - NVIDIA", "Geekbench 6: 21k (Rank #68, top 7%) - AMD"
|
|
74
|
+
*/
|
|
75
|
+
export declare function gpu_bench_info(context: InfoContext): string;
|
|
76
|
+
//# sourceMappingURL=hardware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardware.d.ts","sourceRoot":"","sources":["../../src/info/hardware.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAM3D;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA+DhD;AAED;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA2FhD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAwB1C;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA4DlD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAgF3D;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA4DtD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAyF3D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { InfoContext } from '../types/internal-types';
|
|
2
|
+
/**
|
|
3
|
+
* Gets memory usage in gigabytes
|
|
4
|
+
* Reads from /proc/meminfo on Linux, falls back to os.totalmem()
|
|
5
|
+
* @param context - Info context with cache
|
|
6
|
+
* @returns Memory usage as "used/total GB"
|
|
7
|
+
* @example "12/32GB", "6/16GB"
|
|
8
|
+
*/
|
|
9
|
+
export declare function ram_used(context: InfoContext): string;
|
|
10
|
+
/**
|
|
11
|
+
* Gets available memory in gigabytes
|
|
12
|
+
* Reads MemAvailable from /proc/meminfo (Linux) or derives it from
|
|
13
|
+
* vm_stat's free+inactive pages (macOS)
|
|
14
|
+
* @returns Available memory with "GB available" suffix or empty string
|
|
15
|
+
* @example "12GB available", "4GB available"
|
|
16
|
+
*/
|
|
17
|
+
export declare function memory_available(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Gets swap memory usage
|
|
20
|
+
* Calculates swap usage from /proc/meminfo (Linux) or `sysctl vm.swapusage`
|
|
21
|
+
* (macOS)
|
|
22
|
+
* @returns Swap usage as "percentage (size MB) swap" or empty string
|
|
23
|
+
* @example "15% (512MB) swap", "0% (0MB) swap"
|
|
24
|
+
*/
|
|
25
|
+
export declare function swap_used(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Gets root filesystem disk usage percentage
|
|
28
|
+
* Uses df command on Linux/Android/macOS
|
|
29
|
+
* @param context - Info context with cache
|
|
30
|
+
* @returns Percentage string or empty string
|
|
31
|
+
* @example "45%", "78%"
|
|
32
|
+
*/
|
|
33
|
+
export declare function disk_used(context: InfoContext): string;
|
|
34
|
+
/**
|
|
35
|
+
* Gets disk size (used/total) for each real disk
|
|
36
|
+
* Uses `df -k` on Linux/macOS, filtering out pseudo filesystems, system/boot
|
|
37
|
+
* partitions (e.g. /boot, /System/Volumes/*), and anything under 10GB, since
|
|
38
|
+
* those aren't disks a user would care about. When exactly one real disk is
|
|
39
|
+
* found (the common case) the result omits the mount point; when multiple
|
|
40
|
+
* real disks are found (e.g. a data drive or external volume), each is
|
|
41
|
+
* labeled by its mount point.
|
|
42
|
+
* @param context - Info context with cache
|
|
43
|
+
* @returns Disk size as "used/total GB" or "mount(used/total GB) ..." or empty string
|
|
44
|
+
* @example "256/512GB", "/(100/500GB) /Volumes/Backup(900/2000GB)"
|
|
45
|
+
*/
|
|
46
|
+
export declare function disk_size(context: InfoContext): string;
|
|
47
|
+
/**
|
|
48
|
+
* Gets mounted filesystem information
|
|
49
|
+
* Lists non-system mount points with usage from df (Linux/macOS)
|
|
50
|
+
* On Linux, excludes /, /dev, /proc, /sys and internal /System/Volumes mounts.
|
|
51
|
+
* On macOS, APFS internal volumes (Data, VM, Preboot, Update, ...) all live
|
|
52
|
+
* under /System/Volumes and are not user-relevant, so only /Volumes (external
|
|
53
|
+
* disks, network shares, disk images) are reported.
|
|
54
|
+
* @param context - Info context with cache
|
|
55
|
+
* @returns Space-separated mount points with usage or empty string
|
|
56
|
+
* @example "/home(45%) /mnt/data(78%)", "/Volumes/Backup(78%)"
|
|
57
|
+
*/
|
|
58
|
+
export declare function mount_points(context: InfoContext): string;
|
|
59
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/info/memory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAmCrD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CA+BzC;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,MAAM,CA6ClC;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAsCtD;AAQD;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAmEtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAiDzD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { InfoContext } from '../types/internal-types';
|
|
2
|
+
/**
|
|
3
|
+
* Gets public IP address from ipinfo.io
|
|
4
|
+
* @param context - Info context with cache and IP info
|
|
5
|
+
* @returns Public IPv4 address or empty string
|
|
6
|
+
* @example "203.0.113.42"
|
|
7
|
+
*/
|
|
8
|
+
export declare function ip(context: InfoContext): Promise<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Gets local/private IP address(es)
|
|
11
|
+
* Tries ifconfig and ip commands on Linux, falls back to Node.js API
|
|
12
|
+
* @returns Space-separated local IP addresses (RFC 1918 ranges)
|
|
13
|
+
* @example "192.168.1.100" or "10.0.0.50 192.168.1.100"
|
|
14
|
+
*/
|
|
15
|
+
export declare function iplocal(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Gets geographic city based on public IP
|
|
18
|
+
* @param context - Info context with IP geolocation data
|
|
19
|
+
* @returns City name or empty string
|
|
20
|
+
* @example "San Francisco", "New York", "London"
|
|
21
|
+
*/
|
|
22
|
+
export declare function city(context: InfoContext): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Gets reverse DNS hostname with HTTP prefix
|
|
25
|
+
* @param context - Info context with IP info
|
|
26
|
+
* @returns Domain with http:// prefix or empty string
|
|
27
|
+
* @example "http://example.com", "http://host-203-0-113-42.example.net"
|
|
28
|
+
*/
|
|
29
|
+
export declare function domain(context: InfoContext): Promise<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Gets Internet Service Provider name
|
|
32
|
+
* Strips AS number prefix from organization string
|
|
33
|
+
* @param context - Info context with IP info
|
|
34
|
+
* @returns ISP name or empty string
|
|
35
|
+
* @example "Comcast Cable", "Verizon Business", "Cloudflare Inc"
|
|
36
|
+
*/
|
|
37
|
+
export declare function isp(context: InfoContext): Promise<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Gets active network interface names
|
|
40
|
+
* Lists non-loopback interfaces with IPv4 addresses (Linux/macOS only)
|
|
41
|
+
* @param context - Info context with cache
|
|
42
|
+
* @returns Space-separated interface names or empty string
|
|
43
|
+
* @example "eth0 wlan0", "en0 en1"
|
|
44
|
+
*/
|
|
45
|
+
export declare function network_interfaces(context: InfoContext): string;
|
|
46
|
+
/**
|
|
47
|
+
* Gets open TCP ports with service names
|
|
48
|
+
* Uses lsof to find listening TCP ports (Linux/macOS only)
|
|
49
|
+
* @param context - Info context with cache
|
|
50
|
+
* @returns Space-separated port+process pairs or empty string
|
|
51
|
+
* @example "80http 443http 22ssh", "3000node 5432post"
|
|
52
|
+
*/
|
|
53
|
+
export declare function ports(context: InfoContext): string;
|
|
54
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/info/network.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D;;;;;GAKG;AACH,wBAAsB,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAW9D;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAuChC;AAED;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAWhE;AAED;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAWlE;AAED;;;;;;GAMG;AACH,wBAAsB,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAW/D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA+B/D;AACD;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA+BlD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { InfoContext } from '../types/internal-types';
|
|
2
|
+
/**
|
|
3
|
+
* Gets the current username
|
|
4
|
+
* @returns Current system username
|
|
5
|
+
*/
|
|
6
|
+
export declare function user(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Gets the system hostname
|
|
9
|
+
* @returns Computer hostname/network name
|
|
10
|
+
*/
|
|
11
|
+
export declare function hostname(): string;
|
|
12
|
+
/**
|
|
13
|
+
* Gets operating system name and version
|
|
14
|
+
* Platform-specific detection for Windows, macOS, and Linux
|
|
15
|
+
* @param context - Info context with cache
|
|
16
|
+
* @returns OS name and version string
|
|
17
|
+
* @example "Windows 11 Pro", "macOS Ventura 13.2.1", "Ubuntu 22.04.3 LTS"
|
|
18
|
+
*/
|
|
19
|
+
export declare function os_info(context: InfoContext): string;
|
|
20
|
+
/**
|
|
21
|
+
* Gets kernel version string
|
|
22
|
+
* Returns the operating system kernel version from os.release()
|
|
23
|
+
* @param context - Info context with cache
|
|
24
|
+
* @returns Kernel version string
|
|
25
|
+
* @example "5.15.0-56-generic", "6.11.11-valve12-1-neptune"
|
|
26
|
+
*/
|
|
27
|
+
export declare function kernel(context: InfoContext): string;
|
|
28
|
+
/**
|
|
29
|
+
* Gets device or computer model name
|
|
30
|
+
* Uses WMI on Windows, DMI on Linux, getprop on Android
|
|
31
|
+
* @param context - Info context with cache
|
|
32
|
+
* @returns Device model name or empty string
|
|
33
|
+
* @example "Dell OptiPlex 7090", "MacBook Pro 16-inch", "Valve Steam Deck"
|
|
34
|
+
*/
|
|
35
|
+
export declare function device(context: InfoContext): string;
|
|
36
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/info/platform.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D;;;GAGG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CAEjC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAuCpD;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAOnD;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA0DnD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InfoContext } from '../types/internal-types';
|
|
2
|
+
/**
|
|
3
|
+
* Gets the highest CPU-consuming process
|
|
4
|
+
* Uses ps command to find top process by CPU usage (Linux/macOS only)
|
|
5
|
+
* @param context - Info context with cache
|
|
6
|
+
* @returns Process info as "percentage processname" or empty string
|
|
7
|
+
* @example "8% firefox", "15% chrome", "3% systemd"
|
|
8
|
+
*/
|
|
9
|
+
export declare function top_process(context: InfoContext): string;
|
|
10
|
+
/**
|
|
11
|
+
* Gets system uptime since last boot
|
|
12
|
+
* @returns Uptime formatted as "Xd Yh Zm"
|
|
13
|
+
* @example "2d 14h 23m", "0d 3h 45m"
|
|
14
|
+
*/
|
|
15
|
+
export declare function uptime(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Gets number of logged in users
|
|
18
|
+
* Uses who command to count active user sessions (Linux/macOS only)
|
|
19
|
+
* @returns User count with "users" suffix or empty string
|
|
20
|
+
* @example "3 users", "1 users"
|
|
21
|
+
*/
|
|
22
|
+
export declare function users_logged_in(): string;
|
|
23
|
+
//# sourceMappingURL=process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/info/process.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAqCxD;AAED;;;;GAIG;AACH,wBAAgB,MAAM,IAAI,MAAM,CAM/B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAWxC"}
|