about-system 0.0.18 → 0.0.19

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 CHANGED
@@ -4,25 +4,26 @@ A TypeScript/Node.js library to display comprehensive system information with cu
4
4
 
5
5
  ## Features
6
6
 
7
- - 🚀 **Fast**: Intelligent caching system for quick repeated access
7
+ - 📊 **Comprehensive**: 30+ system metrics including CPU, GPU, network, containers, and more
8
+ - 🌍 **Cross-platform**: Works on Linux, macOS, and Windows, and Android
8
9
  - 🎨 **Customizable**: Configure colors, emojis, and display order
9
10
  - 🔌 **Two Modes**: Use as CLI tool or import as API
10
- - 🌍 **Cross-platform**: Works on Linux, macOS, and Windows
11
- - 📊 **Comprehensive**: 30+ system metrics including CPU, GPU, network, containers, and more
11
+ - 🚀 **Cached**: Intelligent caching system for quick repeated access
12
12
  - 💾 **TypeScript**: Full type definitions included
13
13
 
14
14
  ## Installation
15
15
 
16
16
  ```bash
17
- npm install about-system
17
+ npx about-system
18
18
  ```
19
19
 
20
20
  ```bash
21
- npx about-system
21
+ npm install -g about-system
22
+ about-system
22
23
  ```
23
24
 
24
25
  ```bash
25
- bunx about-system
26
+ bun x about-system
26
27
  ```
27
28
 
28
29
  ## Examples
@@ -70,6 +71,8 @@ about-system --settings-reset
70
71
  # Set specific configuration values
71
72
  about-system --set display.show_emojis false
72
73
  about-system --set colors.user blue
74
+ about-system --set emojis.cpu "🚀 "
75
+ about-system --set labels.cpu "Processor"
73
76
 
74
77
  # Clear cache
75
78
  about-system --refresh
@@ -80,17 +83,17 @@ about-system --refresh
80
83
  ### Basic Example
81
84
 
82
85
  ```typescript
83
- import { getSystemInfo } from 'about-system';
86
+ import { getSystemInfo } from "about-system";
84
87
 
85
88
  // Get all system information as JSON
86
89
  const info = await getSystemInfo();
87
90
 
88
- console.log(info.user); // Current username
89
- console.log(info.hostname); // Computer hostname
90
- console.log(info.os); // Operating system
91
- console.log(info.cpu); // CPU model
92
- console.log(info.ram_used); // RAM usage (e.g., "8/16GB")
93
- console.log(info.disk_used); // Disk usage (e.g., "45%")
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%")
94
97
  ```
95
98
 
96
99
  ### Using Individual Info Functions
@@ -98,7 +101,7 @@ console.log(info.disk_used); // Disk usage (e.g., "45%")
98
101
  You can import and use individual system info functions:
99
102
 
100
103
  ```typescript
101
- import { infoFunctions } from 'about-system/api';
104
+ import { infoFunctions } from "about-system/api";
102
105
 
103
106
  // Create a context with cache
104
107
  const cache = {};
@@ -123,16 +126,16 @@ async function getBasicInfo() {
123
126
 
124
127
  ```typescript
125
128
  // Default import (complete API)
126
- import { getSystemInfo } from 'about-system';
129
+ import { getSystemInfo } from "about-system";
127
130
 
128
131
  // Direct API import with individual functions
129
- import { getSystemInfo, infoFunctions } from 'about-system/api';
132
+ import { getSystemInfo, infoFunctions } from "about-system/api";
130
133
 
131
134
  // CLI functions
132
- import { displaySystemInfo } from 'about-system/cli';
135
+ import { displaySystemInfo } from "about-system/cli";
133
136
 
134
137
  // Types only
135
- import type { SystemInfo, Platform } from 'about-system/types';
138
+ import type { SystemInfo, Platform } from "about-system/types";
136
139
  ```
137
140
 
138
141
  ### All Available Fields
@@ -142,38 +145,38 @@ See the [systeminfo-types.d.ts](src/systeminfo-types.d.ts) file for complete Typ
142
145
  ```typescript
143
146
  interface SystemInfo {
144
147
  // System Identity
145
- timestamp: string; // ISO 8601 timestamp
146
- hostname: string; // Computer hostname
147
- user: string; // Current username
148
- platform: 'linux' | 'windows' | 'macos' | 'unknown';
148
+ timestamp: string; // ISO 8601 timestamp
149
+ hostname: string; // Computer hostname
150
+ user: string; // Current username
151
+ platform: "linux" | "windows" | "macos" | "unknown";
149
152
 
150
153
  // Operating System
151
- os: string; // OS name and version
152
- kernel: string; // Kernel version
153
- shell: string; // Shell program (Linux/Unix)
154
+ os: string; // OS name and version
155
+ kernel: string; // Kernel version
156
+ shell: string; // Shell program (Linux/Unix)
154
157
 
155
158
  // Hardware
156
- cpu: string; // CPU model
157
- gpu: string; // GPU model
158
- device: string; // Device/computer model
159
+ cpu: string; // CPU model
160
+ gpu: string; // GPU model
161
+ device: string; // Device/computer model
159
162
 
160
163
  // Real-time Resources
161
- disk_used: string; // Disk usage percentage
162
- ram_used: string; // RAM usage (used/total GB)
163
- top_process: string; // Top CPU-consuming process
164
- uptime: string; // System uptime (Xd Yh Zm)
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)
165
168
 
166
169
  // Network
167
- ip: string; // Public IP address
168
- iplocal: string; // Local IP address(es)
169
- city: string; // Geographic location
170
- isp: string; // Internet service provider
170
+ ip: string; // Public IP address
171
+ iplocal: string; // Local IP address(es)
172
+ city: string; // Geographic location
173
+ isp: string; // Internet service provider
171
174
 
172
175
  // Linux-specific
173
- temperature: string; // System temperature
174
- battery: string; // Battery percentage
175
- load_average: string; // System load
176
- services_running: string; // Active services count
176
+ temperature: string; // System temperature
177
+ battery: string; // Battery percentage
178
+ load_average: string; // System load
179
+ services_running: string; // Active services count
177
180
 
178
181
  // And 20+ more fields...
179
182
  }
@@ -184,7 +187,7 @@ interface SystemInfo {
184
187
  See [examples/api-usage.js](examples/api-usage.js) for more examples.
185
188
 
186
189
  ```typescript
187
- import { getSystemInfo } from 'about-system';
190
+ import { getSystemInfo } from "about-system";
188
191
 
189
192
  // Example: Monitor system resources
190
193
  async function monitorResources() {
@@ -195,12 +198,12 @@ async function monitorResources() {
195
198
  ram: info.ram_used,
196
199
  disk: info.disk_used,
197
200
  temperature: info.temperature,
198
- topProcess: info.top_process
201
+ topProcess: info.top_process,
199
202
  };
200
203
  }
201
204
 
202
205
  // Example: Create custom dashboard
203
- import { infoFunctions } from 'about-system/api';
206
+ import { infoFunctions } from "about-system/api";
204
207
 
205
208
  async function getDashboardData(context) {
206
209
  return {
@@ -217,7 +220,7 @@ async function getDashboardData(context) {
217
220
  network: {
218
221
  localIP: infoFunctions.iplocal(),
219
222
  publicIP: await infoFunctions.ip(context),
220
- }
223
+ },
221
224
  };
222
225
  }
223
226
  ```
@@ -266,6 +269,8 @@ about-system --settings-reset
266
269
  # Set individual values
267
270
  about-system --set display.show_emojis false
268
271
  about-system --set colors.user blue
272
+ about-system --set emojis.cpu "🚀 "
273
+ about-system --set labels.hostname "Computer"
269
274
  about-system --set cache.enabled true
270
275
 
271
276
  # Clear cache
@@ -278,15 +283,17 @@ about-system --cache-clear
278
283
  {
279
284
  "version": "1.0.0",
280
285
  "display_order": [
281
- "user",
282
- "hostname",
283
- "disk_used",
284
- "ram_used",
285
- "uptime",
286
- "ip",
287
- "os",
288
- "cpu",
289
- "shell"
286
+ ["user", "hostname", "os", "device", "kernel", "cpu", "gpu"],
287
+ [
288
+ "disk_used",
289
+ "ram_used",
290
+ "top_process",
291
+ "uptime",
292
+ "temperature",
293
+ "battery"
294
+ ],
295
+ ["ip", "iplocal", "city", "domain", "isp"],
296
+ ["shell", "pacman", "services_running", "containers"]
290
297
  ],
291
298
  "colors": {
292
299
  "user": "red",
@@ -299,26 +306,78 @@ about-system --cache-clear
299
306
  "cpu": "orange",
300
307
  "shell": "orange"
301
308
  },
309
+ "emojis": {
310
+ "user": "👤 ",
311
+ "hostname": "🏠 ",
312
+ "cpu": "📈 ",
313
+ "gpu": "🎮 ",
314
+ "disk_used": "📁 ",
315
+ "ram_used": "💾 ",
316
+ "ip": "🌎 ",
317
+ "shell": "🐚 "
318
+ },
319
+ "labels": {
320
+ "user": "User",
321
+ "hostname": "Host",
322
+ "cpu": "CPU",
323
+ "gpu": "GPU",
324
+ "disk_used": "Disk",
325
+ "ram_used": "RAM",
326
+ "ip": "IP",
327
+ "shell": "Shell"
328
+ },
302
329
  "display": {
303
330
  "show_emojis": true,
304
- "separator": " ",
305
- "max_width": 120
306
- },
307
- "cache": {
308
- "enabled": true
331
+ "single_line": false,
332
+ "line_wrap_length": 100
309
333
  },
310
334
  "network": {
311
- "timeout": 5000,
312
335
  "show_offline_message": true
336
+ },
337
+ "advanced": {
338
+ "debug": false
313
339
  }
314
340
  }
315
341
  ```
316
342
 
317
- ### Available Colors
343
+ ### Customization Options
344
+
345
+ #### Colors
346
+
347
+ Available color options for each info block:
318
348
 
319
349
  - `red`, `orange`, `yellow`, `green`, `blue`, `cyan`, `purple`, `magenta`, `gray`, `lightblue`
320
350
  - Use `multicolor` for ports to get a rainbow effect
321
351
 
352
+ ```bash
353
+ about-system --set colors.user blue
354
+ about-system --set colors.hostname green
355
+ ```
356
+
357
+ #### Emojis
358
+
359
+ Customize the emoji displayed for each info block. Emojis can be toggled on/off globally with `display.show_emojis` or individually customized:
360
+
361
+ ```bash
362
+ # Toggle emojis on/off
363
+ about-system --set display.show_emojis false
364
+
365
+ # Customize individual emojis
366
+ about-system --set emojis.cpu "🚀 "
367
+ about-system --set emojis.hostname "🖥️ "
368
+ about-system --set emojis.battery "🔋 "
369
+ ```
370
+
371
+ #### Labels
372
+
373
+ Customize the text labels for each info block:
374
+
375
+ ```bash
376
+ about-system --set labels.cpu "Processor"
377
+ about-system --set labels.hostname "Computer"
378
+ about-system --set labels.ram_used "Memory"
379
+ ```
380
+
322
381
  ### Platform-Specific Features
323
382
 
324
383
  #### Windows
@@ -365,7 +424,7 @@ The `--install` flag automatically configures the script as a shell greeting:
365
424
  All API functions include comprehensive JSDoc documentation:
366
425
 
367
426
  ```typescript
368
- import { infoFunctions } from 'about-system/api';
427
+ import { infoFunctions } from "about-system/api";
369
428
 
370
429
  // Hover over any function in your IDE to see:
371
430
  // - Function description
@@ -374,10 +433,11 @@ import { infoFunctions } from 'about-system/api';
374
433
  // - Usage examples
375
434
  // - Platform-specific notes
376
435
 
377
- infoFunctions.cpu(context); // IDE shows full documentation
436
+ infoFunctions.cpu(context); // IDE shows full documentation
378
437
  ```
379
438
 
380
439
  **Features:**
440
+
381
441
  - ✅ Every function documented with JSDoc
382
442
  - ✅ Parameter and return type descriptions
383
443
  - ✅ Real-world usage examples
@@ -387,6 +447,7 @@ infoFunctions.cpu(context); // IDE shows full documentation
387
447
  ### TypeScript Support
388
448
 
389
449
  Full TypeScript definitions with:
450
+
390
451
  - Complete `SystemInfo` interface
391
452
  - All 30+ field types documented
392
453
  - Platform-specific type unions
@@ -394,11 +455,11 @@ Full TypeScript definitions with:
394
455
 
395
456
  ```typescript
396
457
  import type {
397
- SystemInfo, // Main info object
398
- Platform, // Platform type
399
- SystemInfoOptions, // Config options
400
- InfoContext, // Context for functions
401
- } from 'about-system/types';
458
+ SystemInfo, // Main info object
459
+ Platform, // Platform type
460
+ SystemInfoOptions, // Config options
461
+ InfoContext, // Context for functions
462
+ } from "about-system/types";
402
463
  ```
403
464
 
404
465
  ## Project Structure