@axium/sysadmin 0.0.1 → 0.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/sysadmin",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "System administration for Axium",
6
6
  "funding": {
package/dist/_probe.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/_probe.js DELETED
@@ -1,4 +0,0 @@
1
- import { SystemType } from './common.js';
2
- const v = SystemType.def.values;
3
- const _check = v;
4
- console.log(v);
@@ -1,38 +0,0 @@
1
- import { systemInfo } from './info.js';
2
- import { formatBytes } from '@axium/core';
3
- import { styleText } from 'node:util';
4
-
5
- const t = ' ',
6
- t2 = ' ';
7
-
8
- const { cpus, gpus, memory, storage, networkInterfaces, uptime, ...rest } = systemInfo();
9
-
10
- function usage(info) {
11
- return styleText('blueBright', formatBytes(info.used)) + '/' + styleText('blueBright', formatBytes(info.total));
12
- }
13
-
14
- const num = value => styleText('blueBright', value.toString());
15
-
16
- console.log('CPUs:');
17
- for (const cpu of cpus) console.log(t, num(cpu.cores) + 'x', styleText('yellow', cpu.model));
18
-
19
- console.log('GPUs:');
20
- for (const gpu of gpus) {
21
- console.log(t, styleText('yellow', gpu.model));
22
- if (gpu.vram) console.log(t2, 'VRAM:', usage(gpu.vram));
23
- }
24
-
25
- console.log('Memory:', usage(memory));
26
- if (memory.swap) console.log(t, 'Swap:', usage(memory.swap));
27
-
28
- console.log('Storage:');
29
- for (const drive of storage) console.log(t, styleText('yellow', drive.model), usage(drive));
30
-
31
- console.log('Network:');
32
- for (const iface of networkInterfaces) {
33
- console.log(t, styleText('cyanBright', iface.name), styleText('yellow', iface.model), iface.wireless ? '(wireless)' : '(wired)');
34
- if (iface.connected)
35
- console.log(t2, iface.connection ? 'Connected to ' + iface.connection : 'Connected', 'at', num(iface.speed), 'MBit/s');
36
- }
37
-
38
- console.log(rest);