systeminformation 6.0.0-beta.24 → 6.0.0-beta.26

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.
Files changed (80) hide show
  1. package/README.md +57 -6
  2. package/dist/bsd/index.d.ts +3 -0
  3. package/dist/bsd/index.js +7 -1
  4. package/dist/common/darwin.d.ts +1 -0
  5. package/dist/common/darwin.js +15 -3
  6. package/dist/common/defaults.js +15 -4
  7. package/dist/common/disk-speed.d.ts +20 -0
  8. package/dist/common/disk-speed.js +142 -0
  9. package/dist/common/filesys.d.ts +1 -1
  10. package/dist/common/filesys.js +24 -4
  11. package/dist/common/mappings.d.ts +1 -1
  12. package/dist/common/mappings.js +14 -4
  13. package/dist/common/types.d.ts +41 -0
  14. package/dist/common/windows.d.ts +1 -0
  15. package/dist/common/windows.js +19 -5
  16. package/dist/cpu-current-load.js +45 -0
  17. package/dist/cpu-current-speed.js +6 -0
  18. package/dist/darwin/bluetooth.d.ts +1 -1
  19. package/dist/darwin/bluetooth.js +2 -2
  20. package/dist/darwin/cpu-current-speed.d.ts +2 -0
  21. package/dist/darwin/cpu-current-speed.js +30 -0
  22. package/dist/darwin/cpu-temperature.js +7 -13
  23. package/dist/darwin/disk-speed.d.ts +2 -0
  24. package/dist/darwin/disk-speed.js +18 -0
  25. package/dist/darwin/disks-io.js +3 -1
  26. package/dist/darwin/fans.js +11 -13
  27. package/dist/darwin/gpu.d.ts +1 -1
  28. package/dist/darwin/gpu.js +4 -4
  29. package/dist/darwin/index.d.ts +3 -0
  30. package/dist/darwin/index.js +8 -2
  31. package/dist/darwin/network-interfaces.js +14 -4
  32. package/dist/darwin/network-routes.d.ts +3 -0
  33. package/dist/darwin/network-routes.js +74 -0
  34. package/dist/darwin/wifi-connections.js +3 -2
  35. package/dist/disk-speed.d.ts +1 -0
  36. package/dist/disk-speed.js +17 -0
  37. package/dist/get.js +5 -5
  38. package/dist/index.d.ts +12 -8
  39. package/dist/index.js +30 -21
  40. package/dist/inet-speed.d.ts +11 -0
  41. package/dist/inet-speed.js +152 -0
  42. package/dist/linux/block-devices.d.ts +1 -1
  43. package/dist/linux/block-devices.js +21 -5
  44. package/dist/linux/cpu-topology.d.ts +2 -0
  45. package/dist/linux/cpu-topology.js +15 -0
  46. package/dist/linux/disk-speed.d.ts +2 -0
  47. package/dist/linux/disk-speed.js +16 -0
  48. package/dist/linux/disks-io.d.ts +1 -1
  49. package/dist/linux/disks-io.js +18 -7
  50. package/dist/linux/index.d.ts +3 -0
  51. package/dist/linux/index.js +8 -2
  52. package/dist/linux/mem.js +20 -1
  53. package/dist/linux/network-interfaces.js +18 -7
  54. package/dist/linux/network-routes.d.ts +4 -0
  55. package/dist/linux/network-routes.js +69 -0
  56. package/dist/linux/os-info.js +32 -4
  57. package/dist/linux/pci.d.ts +1 -1
  58. package/dist/linux/pci.js +4 -3
  59. package/dist/linux/wifi-connections.d.ts +4 -0
  60. package/dist/linux/wifi-connections.js +20 -2
  61. package/dist/network-routes.d.ts +1 -0
  62. package/dist/network-routes.js +17 -0
  63. package/dist/powershell.d.ts +2 -0
  64. package/dist/powershell.js +15 -0
  65. package/dist/sun/index.d.ts +1 -0
  66. package/dist/sun/index.js +3 -1
  67. package/dist/windows/block-devices.js +6 -1
  68. package/dist/windows/cpu-topology.d.ts +3 -0
  69. package/dist/windows/cpu-topology.js +90 -0
  70. package/dist/windows/disk-speed.d.ts +6 -0
  71. package/dist/windows/disk-speed.js +73 -0
  72. package/dist/windows/disks-io.js +3 -1
  73. package/dist/windows/index.d.ts +3 -0
  74. package/dist/windows/index.js +8 -2
  75. package/dist/windows/network-interfaces.js +6 -3
  76. package/dist/windows/network-routes.d.ts +3 -0
  77. package/dist/windows/network-routes.js +41 -0
  78. package/dist/windows/wifi-connections.d.ts +1 -0
  79. package/dist/windows/wifi-connections.js +10 -3
  80. package/package.json +1 -1
@@ -294,8 +294,6 @@ const getLogoFile = (distro = '') => {
294
294
  return 'windows';
295
295
  case distro.indexOf('mac os') !== -1 || distro.indexOf('macos') !== -1:
296
296
  return 'apple';
297
- case distro.indexOf('arch') !== -1:
298
- return 'arch';
299
297
  case distro.indexOf('cachy') !== -1:
300
298
  return 'cachy';
301
299
  case distro.indexOf('centos') !== -1:
@@ -334,10 +332,20 @@ const getLogoFile = (distro = '') => {
334
332
  return 'pclinuxos';
335
333
  case distro.indexOf('puppy') !== -1:
336
334
  return 'puppy';
337
- case distro.indexOf('popos') !== -1:
335
+ case distro.indexOf('popos') !== -1 || distro.indexOf('pop!_os') !== -1:
338
336
  return 'popos';
339
- case distro.indexOf('raspbian') !== -1:
337
+ case distro.indexOf('raspbian') !== -1 || distro.indexOf('raspberry') !== -1:
340
338
  return 'raspbian';
339
+ case distro.indexOf('nixos') !== -1:
340
+ return 'nixos';
341
+ case distro.indexOf('zorin') !== -1:
342
+ return 'zorin';
343
+ case distro.indexOf('garuda') !== -1:
344
+ return 'garuda';
345
+ case distro.indexOf('nobara') !== -1:
346
+ return 'nobara';
347
+ case distro.indexOf('bazzite') !== -1:
348
+ return 'bazzite';
341
349
  case distro.indexOf('reactos') !== -1:
342
350
  return 'reactos';
343
351
  case distro.indexOf('redhat') !== -1:
@@ -366,6 +374,8 @@ const getLogoFile = (distro = '') => {
366
374
  return 'ferenos';
367
375
  case distro.indexOf('robolinux') !== -1:
368
376
  return 'robolinux';
377
+ case distro.indexOf('arch') !== -1:
378
+ return 'arch';
369
379
  default:
370
380
  return const_1.PLATFORM;
371
381
  }
@@ -376,6 +376,12 @@ export type CurrentLoadCpuData = {
376
376
  rawLoadIdle: number;
377
377
  rawLoadIowait: number;
378
378
  rawLoadIrq: number;
379
+ coreId: number | null;
380
+ socketId: number | null;
381
+ };
382
+ export type CpuTopologyData = {
383
+ coreId: number | null;
384
+ socketId: number | null;
379
385
  };
380
386
  export type WifiNetworkData = {
381
387
  ssid: string;
@@ -409,6 +415,7 @@ export type WifiConnectionData = {
409
415
  signalLevel: number | null;
410
416
  quality: number | null;
411
417
  txRate: number | null;
418
+ rxRate: number | null;
412
419
  };
413
420
  export type InetChecksiteData = {
414
421
  url: string;
@@ -448,6 +455,8 @@ export type MemData = {
448
455
  swapfree: number;
449
456
  writeback: number;
450
457
  dirty: number;
458
+ swapin_sec: number | null;
459
+ swapout_sec: number | null;
451
460
  };
452
461
  export type MemLayoutData = {
453
462
  size: number;
@@ -495,6 +504,14 @@ export type OsData = {
495
504
  remoteSession?: boolean;
496
505
  hypervisor?: boolean;
497
506
  };
507
+ export type InetSpeedData = {
508
+ server: string;
509
+ downloadSpeed: number | null;
510
+ uploadSpeed: number | null;
511
+ downloadMB: number;
512
+ uploadMB: number;
513
+ ms: number;
514
+ };
498
515
  export type InetPublicIpData = {
499
516
  ip4: string;
500
517
  ip6: string;
@@ -641,6 +658,19 @@ export type FsBlockDevicesData = {
641
658
  protocol: string;
642
659
  group: string;
643
660
  device: string;
661
+ partUuid: string;
662
+ partLabel: string;
663
+ partType: string;
664
+ partFlags: string;
665
+ partStart: number | null;
666
+ };
667
+ export type DiskSpeedData = {
668
+ path: string;
669
+ fs: string;
670
+ sizeMB: number;
671
+ writeSpeed: number | null;
672
+ readSpeed: number | null;
673
+ ms: number;
644
674
  };
645
675
  export type FsStatsData = {
646
676
  rx: number;
@@ -664,6 +694,8 @@ export type DisksIoData = {
664
694
  rWaitPercent: number | null;
665
695
  wWaitPercent: number | null;
666
696
  tWaitPercent: number | null;
697
+ busyPercent: number | null;
698
+ idlePercent: number | null;
667
699
  ms: number;
668
700
  };
669
701
  export type SmartData = {
@@ -979,6 +1011,14 @@ export type NetworkInterfacesData = {
979
1011
  ieee8021xAuth: string;
980
1012
  ieee8021xState: string;
981
1013
  carrierChanges: number;
1014
+ bridgeMembers: string[];
1015
+ };
1016
+ export type NetworkRouteData = {
1017
+ destination: string;
1018
+ gateway: string;
1019
+ iface: string;
1020
+ metric: number | null;
1021
+ family: string;
982
1022
  };
983
1023
  export type NetworkStatsData = {
984
1024
  iface: string;
@@ -1053,6 +1093,7 @@ export type PciData = {
1053
1093
  subDeviceId: string;
1054
1094
  revision: string;
1055
1095
  driver: string;
1096
+ iommuGroup: string;
1056
1097
  };
1057
1098
  export type NpuData = {
1058
1099
  vendor: string;
@@ -45,6 +45,7 @@ declare class PowerShellPool {
45
45
  workers: PowerShellWorker[];
46
46
  _rr: number;
47
47
  _started: Promise<void> | null;
48
+ _generation: number;
48
49
  constructor({ size, env }?: {
49
50
  size?: number;
50
51
  env?: NodeJS.ProcessEnv;
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.windowsPciBusAddresses = exports.matchPnpLocation = exports.parseWindowsPnpLocations = exports.parseWindowsLocationInfo = exports.ps = exports.psArray = void 0;
4
4
  const node_child_process_1 = require("node:child_process");
5
- const exec_1 = require("./exec");
6
5
  const files_1 = require("../common/files");
7
6
  const const_1 = require("./const");
7
+ const exec_1 = require("./exec");
8
8
  const JOB_TIMEOUT_MS = 60000;
9
9
  let _powerShell = '';
10
10
  const pickPowerShellExecutable = async () => {
@@ -243,6 +243,7 @@ class PowerShellPool {
243
243
  workers;
244
244
  _rr;
245
245
  _started;
246
+ _generation;
246
247
  constructor({ size = 2, env = { LANG: 'en_US.UTF-8' } } = {}) {
247
248
  this.size = Math.max(1, Math.trunc(size));
248
249
  this.env = env;
@@ -250,18 +251,24 @@ class PowerShellPool {
250
251
  this._rr = 0;
251
252
  this.exe = '';
252
253
  this._started = null;
254
+ this._generation = 0;
253
255
  }
254
256
  start() {
255
257
  if (!this._started) {
258
+ const generation = ++this._generation;
256
259
  this._started = (async () => {
257
- this.exe = await pickPowerShellExecutable();
260
+ const exe = await pickPowerShellExecutable();
261
+ if (generation !== this._generation)
262
+ return;
263
+ this.exe = exe;
258
264
  for (let i = 0; i < this.size; i++) {
259
265
  const w = new PowerShellWorker({ exe: this.exe, env: this.env });
260
266
  w.start();
261
267
  this.workers.push(w);
262
268
  }
263
269
  })().catch((err) => {
264
- this._started = null;
270
+ if (generation === this._generation)
271
+ this._started = null;
265
272
  throw err;
266
273
  });
267
274
  }
@@ -269,6 +276,10 @@ class PowerShellPool {
269
276
  }
270
277
  async exec(script) {
271
278
  await this.start();
279
+ if (!this.workers.length)
280
+ await this.start();
281
+ if (!this.workers.length)
282
+ throw new Error('PowerShell pool not available');
272
283
  const idx = this._rr++ % this.workers.length;
273
284
  let w = this.workers[idx];
274
285
  if (w.dead) {
@@ -279,6 +290,7 @@ class PowerShellPool {
279
290
  return w.exec(script);
280
291
  }
281
292
  async stop() {
293
+ this._generation++;
282
294
  for (const w of this.workers)
283
295
  w.stop();
284
296
  this.workers = [];
@@ -323,7 +335,9 @@ const parseWindowsPnpLocations = (stdout) => {
323
335
  };
324
336
  exports.parseWindowsPnpLocations = parseWindowsPnpLocations;
325
337
  const matchPnpLocation = (deviceId, locations) => {
326
- const id = String(deviceId ?? '').trim().toLowerCase();
338
+ const id = String(deviceId ?? '')
339
+ .trim()
340
+ .toLowerCase();
327
341
  if (!id) {
328
342
  return '';
329
343
  }
@@ -336,7 +350,7 @@ const matchPnpLocation = (deviceId, locations) => {
336
350
  };
337
351
  exports.matchPnpLocation = matchPnpLocation;
338
352
  const PS_PNP_DISPLAY_LOCATIONS = 'Get-PnpDevice -Class Display -PresentOnly -ErrorAction SilentlyContinue | ForEach-Object { ' +
339
- "$l = ($_ | Get-PnpDeviceProperty -KeyName DEVPKEY_Device_LocationInfo -ErrorAction SilentlyContinue).Data; \"$($_.InstanceId)|$l\" }";
353
+ '$l = ($_ | Get-PnpDeviceProperty -KeyName DEVPKEY_Device_LocationInfo -ErrorAction SilentlyContinue).Data; "$($_.InstanceId)|$l" }';
340
354
  const windowsPciBusAddresses = async () => {
341
355
  try {
342
356
  return (0, exports.parseWindowsPnpLocations)(await (0, exec_1.shareInflight)('pnpDisplayLocations', () => exports.ps.exec(PS_PNP_DISPLAY_LOCATIONS)));
@@ -53,6 +53,46 @@ const avgLoadEwma = (previous, busyCores, seconds) => {
53
53
  };
54
54
  exports.avgLoadEwma = avgLoadEwma;
55
55
  const avgLoadFromEwma = (cores) => (cores ? parseFloat((Math.max(..._avgLoadEwma) / cores).toFixed(2)) : 0);
56
+ const TOPOLOGY_TRIES = 3;
57
+ let _topology = [];
58
+ let _topologyRead = null;
59
+ let _topologyTries = 0;
60
+ let _topologyTriesCount = -1;
61
+ const readCpuTopology = async () => {
62
+ switch (true) {
63
+ case const_1.LINUX:
64
+ return (await import('./linux/cpu-topology.js')).cpuTopology();
65
+ case const_1.WINDOWS:
66
+ return (await import('./windows/cpu-topology.js')).cpuTopology();
67
+ case const_1.DARWIN:
68
+ return (0, node_os_1.arch)() === 'arm64' ? (0, node_os_1.cpus)().map((_, i) => ({ coreId: i, socketId: 0 })) : [];
69
+ default:
70
+ return [];
71
+ }
72
+ };
73
+ const cpuTopology = async (count) => {
74
+ if (_topology.length !== count) {
75
+ if (_topologyTriesCount !== count) {
76
+ _topologyTriesCount = count;
77
+ _topologyTries = 0;
78
+ }
79
+ if (_topologyTries < TOPOLOGY_TRIES || _topologyRead) {
80
+ if (!_topologyRead) {
81
+ _topologyTries++;
82
+ _topologyRead = readCpuTopology()
83
+ .catch(() => [])
84
+ .finally(() => {
85
+ _topologyRead = null;
86
+ });
87
+ }
88
+ const topology = await _topologyRead;
89
+ if (topology.length === count) {
90
+ _topology = topology;
91
+ }
92
+ }
93
+ }
94
+ return _topology.length === count ? _topology : [];
95
+ };
56
96
  const currentLoad = async () => {
57
97
  await (0, common_1.nextTick)();
58
98
  const loads = (0, node_os_1.loadavg)().map((x) => x / (0, node_os_1.cpus)().length);
@@ -290,6 +330,11 @@ const currentLoad = async () => {
290
330
  cpus: cores
291
331
  };
292
332
  }
333
+ const topology = await cpuTopology(result.cpus.length);
334
+ result.cpus.forEach((core, i) => {
335
+ core.coreId = topology[i]?.coreId ?? null;
336
+ core.socketId = topology[i]?.socketId ?? null;
337
+ });
293
338
  return result;
294
339
  };
295
340
  exports.currentLoad = currentLoad;
@@ -71,6 +71,12 @@ const getCpuCurrentSpeed = async () => {
71
71
  exports.getCpuCurrentSpeed = getCpuCurrentSpeed;
72
72
  const cpuCurrentSpeed = async () => {
73
73
  await (0, common_1.nextTick)();
74
+ if (const_1.DARWIN && (0, node_os_1.arch)() === 'arm64') {
75
+ const appleSilicon = await (await import('./darwin/cpu-current-speed.js')).appleSiliconSpeed();
76
+ if (appleSilicon) {
77
+ return appleSilicon;
78
+ }
79
+ }
74
80
  let result = await (0, exports.getCpuCurrentSpeed)();
75
81
  if (result.avg === 0 && (0, cpu_1.getCpuSpeed)() !== 0) {
76
82
  const currCpuSpeed = (0, cpu_1.getCpuSpeed)();
@@ -1,3 +1,3 @@
1
- import { BluetoothObject } from '../common/types';
1
+ import type { BluetoothObject } from '../common/types';
2
2
  export declare const parseBluetooth: (outObj: any) => BluetoothObject[];
3
3
  export declare const bluetoothDevices: () => Promise<BluetoothObject[]>;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.bluetoothDevices = exports.parseBluetooth = void 0;
4
- const darwin_1 = require("./../common/darwin");
5
4
  const common_1 = require("../common");
5
+ const darwin_1 = require("./../common/darwin");
6
6
  const exec_1 = require("../common/exec");
7
7
  const mappings_1 = require("../common/mappings");
8
8
  const deviceId = (id) => {
9
- return id.split(' &lt; ')[0];
9
+ return id.split(' < ')[0];
10
10
  };
11
11
  const parseBluetoothObjects = (bluetoothObject, macAddr2) => {
12
12
  const typeStr = ((bluetoothObject.device_minorClassOfDevice_string || bluetoothObject.device_majorClassOfDevice_string || bluetoothObject.device_minorType || '') + (bluetoothObject.device_name || '')).toLowerCase();
@@ -0,0 +1,2 @@
1
+ import type { CpuCurrentSpeedObject } from '../common/types';
2
+ export declare const appleSiliconSpeed: () => Promise<CpuCurrentSpeedObject | null>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.appleSiliconSpeed = void 0;
4
+ const round2 = (value) => Math.round(value * 100) / 100;
5
+ const appleSiliconSpeed = async () => {
6
+ try {
7
+ const smc = require('macos-smc');
8
+ if (typeof smc.frequencies !== 'function') {
9
+ return null;
10
+ }
11
+ const res = await smc.frequencies();
12
+ const cores = (res?.cpu?.cores || [])
13
+ .map((core) => (typeof core?.mhz === 'number' ? core.mhz : core?.minMhz))
14
+ .filter((mhz) => typeof mhz === 'number' && mhz > 0)
15
+ .map((mhz) => round2(mhz / 1000));
16
+ if (!cores.length) {
17
+ return null;
18
+ }
19
+ return {
20
+ min: Math.min(...cores),
21
+ max: Math.max(...cores),
22
+ avg: round2(cores.reduce((sum, speed) => sum + speed, 0) / cores.length),
23
+ cores
24
+ };
25
+ }
26
+ catch {
27
+ return null;
28
+ }
29
+ };
30
+ exports.appleSiliconSpeed = appleSiliconSpeed;
@@ -23,19 +23,13 @@ const cpuTemperature = async () => {
23
23
  }
24
24
  catch { }
25
25
  try {
26
- const macosTemp = require('macos-temperature-sensor');
27
- const res = macosTemp.temperature();
28
- if (res.cpu) {
29
- result.main = Math.round(res.cpu * 100) / 100;
30
- result.max = result.main;
31
- }
32
- if (res.soc) {
33
- result.chipset = Math.round(res.soc * 100) / 100;
34
- }
35
- if (res && res.cpuDieTemps && res.cpuDieTemps.length) {
36
- for (const temp of res.cpuDieTemps) {
37
- result.cores.push(Math.round(temp * 100) / 100);
38
- }
26
+ const smc = require('macos-smc');
27
+ const cpu = smc.temperatures()?.cpu;
28
+ if (typeof cpu?.max === 'number') {
29
+ const round2 = (value) => Math.round(value * 100) / 100;
30
+ result.main = round2(typeof cpu.avg === 'number' ? cpu.avg : cpu.max);
31
+ result.max = round2(cpu.max);
32
+ result.cores = (cpu.sensors || []).map((sensor) => round2(sensor.value));
39
33
  }
40
34
  }
41
35
  catch { }
@@ -0,0 +1,2 @@
1
+ import type { DiskSpeedData } from '../common/types';
2
+ export declare const diskSpeed: (path?: string, sizeMB?: number) => Promise<DiskSpeedData | null>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.diskSpeed = void 0;
4
+ const disk_speed_1 = require("../common/disk-speed");
5
+ const noCache = (fd) => {
6
+ try {
7
+ const smc = require('macos-smc');
8
+ return typeof smc.noCache === 'function' && smc.noCache(fd) === true;
9
+ }
10
+ catch {
11
+ return false;
12
+ }
13
+ };
14
+ const diskSpeed = (path, sizeMB) => (0, disk_speed_1.runDiskSpeed)(path, sizeMB, {
15
+ prepareWrite: noCache,
16
+ readUncached: (file, bytes) => (0, disk_speed_1.readFileTimed)(file, bytes, noCache)
17
+ });
18
+ exports.diskSpeed = diskSpeed;
@@ -49,7 +49,9 @@ const disksIO = async () => {
49
49
  tWaitTime: filesys_1._disk_io.tWaitTimeDelta,
50
50
  rWaitPercent: filesys_1._disk_io.rWaitPercent,
51
51
  wWaitPercent: filesys_1._disk_io.wWaitPercent,
52
- tWaitPercent: filesys_1._disk_io.tWaitPercent
52
+ tWaitPercent: filesys_1._disk_io.tWaitPercent,
53
+ busyPercent: filesys_1._disk_io.busyPercent,
54
+ idlePercent: filesys_1._disk_io.idlePercent
53
55
  };
54
56
  }
55
57
  };
@@ -6,20 +6,18 @@ const fans = async () => {
6
6
  await (0, common_1.nextTick)();
7
7
  const result = [];
8
8
  try {
9
- const macosTemp = require('macos-temperature-sensor');
10
- if (typeof macosTemp.fans === 'function') {
11
- const res = macosTemp.fans();
12
- if (Array.isArray(res)) {
13
- res.forEach((fan, index) => {
14
- result.push({
15
- id: `fan${index}`,
16
- label: fan?.label || null,
17
- rpm: typeof fan?.rpm === 'number' ? Math.round(fan.rpm) : null,
18
- pwm: typeof fan?.pwm === 'number' ? Math.round(fan.pwm) : null,
19
- source: 'SMC'
20
- });
9
+ const smc = require('macos-smc');
10
+ const res = smc.fans();
11
+ if (Array.isArray(res)) {
12
+ res.forEach((fan, index) => {
13
+ result.push({
14
+ id: `fan${typeof fan?.id === 'number' ? fan.id : index}`,
15
+ label: null,
16
+ rpm: typeof fan?.rpm === 'number' ? Math.round(fan.rpm) : null,
17
+ pwm: typeof fan?.percent === 'number' ? Math.round(fan.percent) : null,
18
+ source: 'SMC'
21
19
  });
22
- }
20
+ });
23
21
  }
24
22
  }
25
23
  catch { }
@@ -1,2 +1,2 @@
1
- import { GpuData } from '../common/types';
1
+ import type { GpuData } from '../common/types';
2
2
  export declare const gpu: () => Promise<GpuData[]>;
@@ -37,12 +37,12 @@ const gpu = async () => {
37
37
  const { stdout } = await (0, exec_1.shareInflight)('SPDisplaysDataType', () => (0, exec_1.exec)('system_profiler -xml -detailLevel full SPDisplaysDataType'));
38
38
  result = parseControllersDarwin((0, darwin_1.plistParser)(stdout));
39
39
  try {
40
- const macosTemp = require('macos-temperature-sensor');
41
- const temps = macosTemp.temperature();
42
- if (temps && temps.gpu) {
40
+ const smc = require('macos-smc');
41
+ const gpuMax = smc.temperatures()?.gpu?.max;
42
+ if (typeof gpuMax === 'number') {
43
43
  for (const controller of result) {
44
44
  if (controller.bus === 'Built-In') {
45
- controller.temperatureGpu = Math.round(temps.gpu * 100) / 100;
45
+ controller.temperatureGpu = Math.round(gpuMax * 100) / 100;
46
46
  }
47
47
  }
48
48
  }
@@ -14,6 +14,7 @@ export { cpuTemperature } from './cpu-temperature';
14
14
  export { fans } from './fans';
15
15
  export { currentLoad } from '../cpu-current-load';
16
16
  export { diskLayout } from './disk-layout';
17
+ export { diskSpeed } from './disk-speed';
17
18
  export { disksIO } from './disks-io';
18
19
  export { displays } from './displays';
19
20
  export { dockerInfo, dockerImages, dockerContainers, dockerContainerStats, dockerContainerProcesses, dockerVolumes, dockerAll } from '../docker';
@@ -23,6 +24,7 @@ export { fsStats } from './fs-stats';
23
24
  export { fullLoad } from '../cpu-full-load';
24
25
  export { gpu } from './gpu';
25
26
  export { inetChecksite } from '../inet-checksite';
27
+ export { inetSpeed } from '../inet-speed';
26
28
  export { inetLatency } from '../linux/inet-latency';
27
29
  export { keyboard } from './keyboard';
28
30
  export { mem } from './mem';
@@ -32,6 +34,7 @@ export { networkConnections } from './network-connections';
32
34
  export { networkGatewayDefault } from './network-gateway-default';
33
35
  export { networkInterfaceDefault } from './network-interface-default';
34
36
  export { networkInterfaces } from './network-interfaces';
37
+ export { networkRoutes } from './network-routes';
35
38
  export { networkStats } from './network-stats';
36
39
  export { npm } from './npm';
37
40
  export { npu } from './npu';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.services = exports.processFocused = exports.processLoad = exports.processes = exports.printer = exports.pci = exports.osInfo = exports.npu = exports.npm = exports.networkStats = exports.networkInterfaces = exports.networkInterfaceDefault = exports.networkGatewayDefault = exports.networkConnections = exports.mouse = exports.memLayout = exports.mem = exports.keyboard = exports.inetLatency = exports.inetChecksite = exports.gpu = exports.fullLoad = exports.fsStats = exports.fsSize = exports.fsOpenFiles = exports.dockerAll = exports.dockerVolumes = exports.dockerContainerProcesses = exports.dockerContainerStats = exports.dockerContainers = exports.dockerImages = exports.dockerInfo = exports.displays = exports.disksIO = exports.diskLayout = exports.currentLoad = exports.fans = exports.cpuTemperature = exports.cpuFlags = exports.cpuCurrentSpeed = exports.cpuCache = exports.cpu = exports.chassis = exports.camera = exports.bluetoothDevices = exports.blockDevices = exports.bios = exports.battery = exports.baseboard = exports.audio = void 0;
4
- exports.wifiNetworks = exports.wifiInterfaces = exports.wifiConnections = exports.versions = exports.version = exports.vboxInfo = exports.uuid = exports.users = exports.usb = exports.serialPorts = exports.time = exports.thunderbolt = exports.system = exports.software = exports.shell = void 0;
3
+ exports.processes = exports.printer = exports.pci = exports.osInfo = exports.npu = exports.npm = exports.networkStats = exports.networkRoutes = exports.networkInterfaces = exports.networkInterfaceDefault = exports.networkGatewayDefault = exports.networkConnections = exports.mouse = exports.memLayout = exports.mem = exports.keyboard = exports.inetLatency = exports.inetSpeed = exports.inetChecksite = exports.gpu = exports.fullLoad = exports.fsStats = exports.fsSize = exports.fsOpenFiles = exports.dockerAll = exports.dockerVolumes = exports.dockerContainerProcesses = exports.dockerContainerStats = exports.dockerContainers = exports.dockerImages = exports.dockerInfo = exports.displays = exports.disksIO = exports.diskSpeed = exports.diskLayout = exports.currentLoad = exports.fans = exports.cpuTemperature = exports.cpuFlags = exports.cpuCurrentSpeed = exports.cpuCache = exports.cpu = exports.chassis = exports.camera = exports.bluetoothDevices = exports.blockDevices = exports.bios = exports.battery = exports.baseboard = exports.audio = void 0;
4
+ exports.wifiNetworks = exports.wifiInterfaces = exports.wifiConnections = exports.versions = exports.version = exports.vboxInfo = exports.uuid = exports.users = exports.usb = exports.serialPorts = exports.time = exports.thunderbolt = exports.system = exports.software = exports.shell = exports.services = exports.processFocused = exports.processLoad = void 0;
5
5
  var audio_1 = require("./audio");
6
6
  Object.defineProperty(exports, "audio", { enumerable: true, get: function () { return audio_1.audio; } });
7
7
  var baseboard_1 = require("./baseboard");
@@ -34,6 +34,8 @@ var cpu_current_load_1 = require("../cpu-current-load");
34
34
  Object.defineProperty(exports, "currentLoad", { enumerable: true, get: function () { return cpu_current_load_1.currentLoad; } });
35
35
  var disk_layout_1 = require("./disk-layout");
36
36
  Object.defineProperty(exports, "diskLayout", { enumerable: true, get: function () { return disk_layout_1.diskLayout; } });
37
+ var disk_speed_1 = require("./disk-speed");
38
+ Object.defineProperty(exports, "diskSpeed", { enumerable: true, get: function () { return disk_speed_1.diskSpeed; } });
37
39
  var disks_io_1 = require("./disks-io");
38
40
  Object.defineProperty(exports, "disksIO", { enumerable: true, get: function () { return disks_io_1.disksIO; } });
39
41
  var displays_1 = require("./displays");
@@ -58,6 +60,8 @@ var gpu_1 = require("./gpu");
58
60
  Object.defineProperty(exports, "gpu", { enumerable: true, get: function () { return gpu_1.gpu; } });
59
61
  var inet_checksite_1 = require("../inet-checksite");
60
62
  Object.defineProperty(exports, "inetChecksite", { enumerable: true, get: function () { return inet_checksite_1.inetChecksite; } });
63
+ var inet_speed_1 = require("../inet-speed");
64
+ Object.defineProperty(exports, "inetSpeed", { enumerable: true, get: function () { return inet_speed_1.inetSpeed; } });
61
65
  var inet_latency_1 = require("../linux/inet-latency");
62
66
  Object.defineProperty(exports, "inetLatency", { enumerable: true, get: function () { return inet_latency_1.inetLatency; } });
63
67
  var keyboard_1 = require("./keyboard");
@@ -76,6 +80,8 @@ var network_interface_default_1 = require("./network-interface-default");
76
80
  Object.defineProperty(exports, "networkInterfaceDefault", { enumerable: true, get: function () { return network_interface_default_1.networkInterfaceDefault; } });
77
81
  var network_interfaces_1 = require("./network-interfaces");
78
82
  Object.defineProperty(exports, "networkInterfaces", { enumerable: true, get: function () { return network_interfaces_1.networkInterfaces; } });
83
+ var network_routes_1 = require("./network-routes");
84
+ Object.defineProperty(exports, "networkRoutes", { enumerable: true, get: function () { return network_routes_1.networkRoutes; } });
79
85
  var network_stats_1 = require("./network-stats");
80
86
  Object.defineProperty(exports, "networkStats", { enumerable: true, get: function () { return network_stats_1.networkStats; } });
81
87
  var npm_1 = require("./npm");
@@ -41,7 +41,8 @@ const parseLinesDarwinNics = (sections) => {
41
41
  type: '',
42
42
  operstate: '',
43
43
  duplex: '',
44
- internal: false
44
+ internal: false,
45
+ bridgeMembers: []
45
46
  };
46
47
  const first = section[0];
47
48
  nic.iface = first.split(':')[0].trim();
@@ -61,6 +62,9 @@ const parseLinesDarwinNics = (sections) => {
61
62
  if (line.trim().startsWith('inet ') && !nic.ip4) {
62
63
  nic.ip4 = line.split('inet ')[1].toLowerCase().split(' ')[0];
63
64
  }
65
+ if (line.trim().startsWith('member: ')) {
66
+ nic.bridgeMembers.push(line.trim().split(/\s+/)[1]);
67
+ }
64
68
  });
65
69
  let speed = (0, common_1.getValue)(section, 'link rate');
66
70
  nic.speed = speed ? parseFloat(speed) : null;
@@ -109,7 +113,12 @@ const parseBsdGateways = (stdout) => {
109
113
  if (parts[0] !== 'default' || parts.length < 3 || !parts[1].includes('.')) {
110
114
  continue;
111
115
  }
112
- const iface = ifaceColumn > 0 ? parts[ifaceColumn] : parts.slice(2).reverse().find((part) => /^[a-z][a-z0-9]*\d$/.test(part));
116
+ const iface = ifaceColumn > 0
117
+ ? parts[ifaceColumn]
118
+ : parts
119
+ .slice(2)
120
+ .reverse()
121
+ .find((part) => /^[a-z][a-z0-9]*\d$/.test(part));
113
122
  if (iface && !result[iface]) {
114
123
  result[iface] = parts[1];
115
124
  }
@@ -189,7 +198,7 @@ const networkInterfaces = async (defaultString = '', rescan = true) => {
189
198
  return (0, network_1.filterDefaultInterface)(_networkInterfaces, defaultString);
190
199
  }
191
200
  _interfaces = (0, index_1.cloneObj)(interfaces);
192
- let result = [];
201
+ const result = [];
193
202
  try {
194
203
  const [nics, defaultInterface, gateways, vendors] = await Promise.all([getBsdNics(), (0, network_interface_default_1.networkInterfaceDefault)(), getBsdGateways(), getBsdNicVendors()]);
195
204
  for (const nic of nics) {
@@ -260,7 +269,8 @@ const networkInterfaces = async (defaultString = '', rescan = true) => {
260
269
  dnsSuffix: '',
261
270
  ieee8021xAuth: '',
262
271
  ieee8021xState: '',
263
- carrierChanges: 0
272
+ carrierChanges: 0,
273
+ bridgeMembers: nic.bridgeMembers
264
274
  });
265
275
  }
266
276
  _networkInterfaces = result;
@@ -0,0 +1,3 @@
1
+ import type { NetworkRouteData } from '../common/types';
2
+ export declare const parseNetstatRoutes: (stdout: string) => NetworkRouteData[];
3
+ export declare const networkRoutes: () => Promise<NetworkRouteData[]>;