about-system 0.0.19 → 0.0.22
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 +9 -178
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://i.imgur.com/1kwKBTR.png" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
# About System Info
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
A TypeScript/Node.js library to display comprehensive system information with customizable output.
|
|
6
8
|
|
|
7
9
|
- 📊 **Comprehensive**: 30+ system metrics including CPU, GPU, network, containers, and more
|
|
8
10
|
- 🌍 **Cross-platform**: Works on Linux, macOS, and Windows, and Android
|
|
@@ -80,28 +82,10 @@ about-system --refresh
|
|
|
80
82
|
|
|
81
83
|
## API Usage
|
|
82
84
|
|
|
83
|
-
### Basic Example
|
|
84
|
-
|
|
85
|
-
```typescript
|
|
86
|
-
import { getSystemInfo } from "about-system";
|
|
87
|
-
|
|
88
|
-
// Get all system information as JSON
|
|
89
|
-
const info = await getSystemInfo();
|
|
90
|
-
|
|
91
|
-
console.log(info.user); // Current username
|
|
92
|
-
console.log(info.hostname); // Computer hostname
|
|
93
|
-
console.log(info.os); // Operating system
|
|
94
|
-
console.log(info.cpu); // CPU model
|
|
95
|
-
console.log(info.ram_used); // RAM usage (e.g., "8/16GB")
|
|
96
|
-
console.log(info.disk_used); // Disk usage (e.g., "45%")
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Using Individual Info Functions
|
|
100
|
-
|
|
101
85
|
You can import and use individual system info functions:
|
|
102
86
|
|
|
103
87
|
```typescript
|
|
104
|
-
import { infoFunctions } from "about-system
|
|
88
|
+
import { infoFunctions, getSystemInfo } from "about-system";
|
|
105
89
|
|
|
106
90
|
// Create a context with cache
|
|
107
91
|
const cache = {};
|
|
@@ -122,113 +106,10 @@ async function getBasicInfo() {
|
|
|
122
106
|
}
|
|
123
107
|
```
|
|
124
108
|
|
|
125
|
-
### Multiple Import Styles
|
|
126
|
-
|
|
127
|
-
```typescript
|
|
128
|
-
// Default import (complete API)
|
|
129
|
-
import { getSystemInfo } from "about-system";
|
|
130
|
-
|
|
131
|
-
// Direct API import with individual functions
|
|
132
|
-
import { getSystemInfo, infoFunctions } from "about-system/api";
|
|
133
|
-
|
|
134
|
-
// CLI functions
|
|
135
|
-
import { displaySystemInfo } from "about-system/cli";
|
|
136
|
-
|
|
137
|
-
// Types only
|
|
138
|
-
import type { SystemInfo, Platform } from "about-system/types";
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### All Available Fields
|
|
142
|
-
|
|
143
|
-
See the [systeminfo-types.d.ts](src/systeminfo-types.d.ts) file for complete TypeScript definitions with detailed JSDoc comments.
|
|
144
|
-
|
|
145
|
-
```typescript
|
|
146
|
-
interface SystemInfo {
|
|
147
|
-
// System Identity
|
|
148
|
-
timestamp: string; // ISO 8601 timestamp
|
|
149
|
-
hostname: string; // Computer hostname
|
|
150
|
-
user: string; // Current username
|
|
151
|
-
platform: "linux" | "windows" | "macos" | "unknown";
|
|
152
|
-
|
|
153
|
-
// Operating System
|
|
154
|
-
os: string; // OS name and version
|
|
155
|
-
kernel: string; // Kernel version
|
|
156
|
-
shell: string; // Shell program (Linux/Unix)
|
|
157
|
-
|
|
158
|
-
// Hardware
|
|
159
|
-
cpu: string; // CPU model
|
|
160
|
-
gpu: string; // GPU model
|
|
161
|
-
device: string; // Device/computer model
|
|
162
|
-
|
|
163
|
-
// Real-time Resources
|
|
164
|
-
disk_used: string; // Disk usage percentage
|
|
165
|
-
ram_used: string; // RAM usage (used/total GB)
|
|
166
|
-
top_process: string; // Top CPU-consuming process
|
|
167
|
-
uptime: string; // System uptime (Xd Yh Zm)
|
|
168
|
-
|
|
169
|
-
// Network
|
|
170
|
-
ip: string; // Public IP address
|
|
171
|
-
iplocal: string; // Local IP address(es)
|
|
172
|
-
city: string; // Geographic location
|
|
173
|
-
isp: string; // Internet service provider
|
|
174
|
-
|
|
175
|
-
// Linux-specific
|
|
176
|
-
temperature: string; // System temperature
|
|
177
|
-
battery: string; // Battery percentage
|
|
178
|
-
load_average: string; // System load
|
|
179
|
-
services_running: string; // Active services count
|
|
180
|
-
|
|
181
|
-
// And 20+ more fields...
|
|
182
|
-
}
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Advanced Examples
|
|
186
|
-
|
|
187
|
-
See [examples/api-usage.js](examples/api-usage.js) for more examples.
|
|
188
|
-
|
|
189
|
-
```typescript
|
|
190
|
-
import { getSystemInfo } from "about-system";
|
|
191
|
-
|
|
192
|
-
// Example: Monitor system resources
|
|
193
|
-
async function monitorResources() {
|
|
194
|
-
const info = await getSystemInfo();
|
|
195
|
-
|
|
196
|
-
return {
|
|
197
|
-
cpu: info.cpu,
|
|
198
|
-
ram: info.ram_used,
|
|
199
|
-
disk: info.disk_used,
|
|
200
|
-
temperature: info.temperature,
|
|
201
|
-
topProcess: info.top_process,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// Example: Create custom dashboard
|
|
206
|
-
import { infoFunctions } from "about-system/api";
|
|
207
|
-
|
|
208
|
-
async function getDashboardData(context) {
|
|
209
|
-
return {
|
|
210
|
-
hardware: {
|
|
211
|
-
cpu: infoFunctions.cpu(context),
|
|
212
|
-
gpu: infoFunctions.gpu(context),
|
|
213
|
-
device: infoFunctions.device(context),
|
|
214
|
-
},
|
|
215
|
-
resources: {
|
|
216
|
-
ram: infoFunctions.ram_used(context),
|
|
217
|
-
disk: infoFunctions.disk_used(context),
|
|
218
|
-
uptime: infoFunctions.uptime(),
|
|
219
|
-
},
|
|
220
|
-
network: {
|
|
221
|
-
localIP: infoFunctions.iplocal(),
|
|
222
|
-
publicIP: await infoFunctions.ip(context),
|
|
223
|
-
},
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
```
|
|
227
|
-
|
|
228
109
|
### Available Info Blocks
|
|
229
110
|
|
|
230
|
-
| Block
|
|
231
|
-
|
|
|
111
|
+
| Block | Description | Example Output |
|
|
112
|
+
| --------------- | -------------------------- | ------------------------------ |
|
|
232
113
|
| `user` | Current username | `👤 username` |
|
|
233
114
|
| `hostname` | System hostname | `🏠 hostname` |
|
|
234
115
|
| `ip` | Public IP address | `🌎 192.168.1.1` |
|
|
@@ -242,7 +123,7 @@ async function getDashboardData(context) {
|
|
|
242
123
|
| `disk_used` | Disk usage percentage | `📁 75%` |
|
|
243
124
|
| `ram_used` | Memory usage | `💾 8/16GB` |
|
|
244
125
|
| `top_process` | Highest CPU process | `🔝 15% chrome` |
|
|
245
|
-
| `uptime` | System uptime | `⏱️ 2d 5h 30m`
|
|
126
|
+
| `uptime` | System uptime | `⏱️ 2d 5h 30m` |
|
|
246
127
|
| `device` | Device model | `💻 MacBook Pro` |
|
|
247
128
|
| `kernel` | Kernel version | `🔧 5.15.0-56-generic` |
|
|
248
129
|
| `shell` | Current shell | `🐚 fish` |
|
|
@@ -462,56 +343,6 @@ import type {
|
|
|
462
343
|
} from "about-system/types";
|
|
463
344
|
```
|
|
464
345
|
|
|
465
|
-
## Project Structure
|
|
466
|
-
|
|
467
|
-
```
|
|
468
|
-
about-system-info/
|
|
469
|
-
├── src/
|
|
470
|
-
│ ├── system-info-api.ts # Core API with JSDoc (exported infoFunctions)
|
|
471
|
-
│ ├── about-system-cli.ts # CLI interface
|
|
472
|
-
│ ├── index.ts # Main entry point
|
|
473
|
-
│ └── systeminfo-types.d.ts # TypeScript type definitions
|
|
474
|
-
├── dist/ # Compiled JavaScript output (Vite build)
|
|
475
|
-
│ ├── index.js # Main entry (0.19 KB)
|
|
476
|
-
│ ├── system-info-api.js # Core API (21 KB)
|
|
477
|
-
│ ├── about-system-cli.js # CLI (10 KB)
|
|
478
|
-
│ └── *.d.ts # Type definitions
|
|
479
|
-
├── examples/
|
|
480
|
-
│ └── api-usage.js # Example API usage
|
|
481
|
-
├── vite.config.ts # Vite build configuration
|
|
482
|
-
├── tsconfig.json # TypeScript configuration
|
|
483
|
-
├── package.json
|
|
484
|
-
└── README.md
|
|
485
|
-
```
|
|
486
|
-
|
|
487
|
-
## Development
|
|
488
|
-
|
|
489
|
-
```bash
|
|
490
|
-
# Clone the repository
|
|
491
|
-
git clone https://github.com/OpenSourceAGI/StarterDOCS.git
|
|
492
|
-
cd StarterDOCS/packages/about-system-info
|
|
493
|
-
|
|
494
|
-
# Install dependencies
|
|
495
|
-
npm install
|
|
496
|
-
|
|
497
|
-
# Build TypeScript
|
|
498
|
-
npm run build
|
|
499
|
-
|
|
500
|
-
# Run CLI
|
|
501
|
-
npm start
|
|
502
|
-
|
|
503
|
-
# Watch mode for development
|
|
504
|
-
npm run dev
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
## Contributing
|
|
508
|
-
|
|
509
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
510
|
-
|
|
511
|
-
## License
|
|
512
|
-
|
|
513
|
-
rights.institute/prosper
|
|
514
|
-
|
|
515
346
|
## Links
|
|
516
347
|
|
|
517
348
|
- [Repository](https://github.com/OpenSourceAGI/StarterDOCS/tree/master/packages/about-system-info)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "about-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
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",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"license": "rights.institute/prosper",
|
|
57
57
|
"repository": {
|
|
58
58
|
"type": "git",
|
|
59
|
-
"url": "https://github.com/OpenSourceAGI/
|
|
59
|
+
"url": "https://github.com/OpenSourceAGI/appdemo-dev-tools/tree/master/packages/about-system-info"
|
|
60
60
|
},
|
|
61
|
-
"homepage": "https://github.com/OpenSourceAGI/
|
|
61
|
+
"homepage": "https://github.com/OpenSourceAGI/appdemo-dev-tools/tree/master/packages/about-system-info",
|
|
62
62
|
"files": [
|
|
63
63
|
"dist/**/*",
|
|
64
64
|
"src/**/*.ts",
|