systeminformation 5.32.0 → 5.33.1

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
@@ -163,7 +163,8 @@ si.cpu()
163
163
 
164
164
  (last 7 major and minor version releases)
165
165
 
166
- - Version 5.32.0: `graphics()` added temperature values (macOS), `dockerContainer()` addes labels
166
+ - Version 5.33.0: `dockerContainer()` added status (healtthy, ...)
167
+ - Version 5.32.0: `graphics()` added temperature values (macOS), `dockerContainers()` added labels
167
168
  - Version 5.31.0: `diskLayout()` added smartmontools support (macOS)
168
169
  - Version 5.30.0: `processes()` added user (windows) - needed to be reverted
169
170
  - Version 5.29.0: `osInfo()` added OS code name (windows)
@@ -831,6 +832,7 @@ Full function reference with examples can be found at
831
832
  | | [0].createdAt | X | X | X | X | X | creation date time string |
832
833
  | | [0].startedAt | X | X | X | X | X | creation date time string |
833
834
  | | [0].finishedAt | X | X | X | X | X | creation date time string |
835
+ | | [0].status | X | X | X | X | X | healthy, starting, unhealthy |
834
836
  | | [0].state | X | X | X | X | X | created, running, exited |
835
837
  | | [0].labels | X | X | X | X | X | object of labels (key-value pairs) |
836
838
  | | [0].ports | X | X | X | X | X | array of ports |
package/lib/docker.js CHANGED
@@ -315,6 +315,7 @@ function dockerContainerInspect(containerID, payload) {
315
315
  createdAt: data.Created ? data.Created : '',
316
316
  startedAt: data.State && data.State.StartedAt ? data.State.StartedAt : '',
317
317
  finishedAt: data.State && data.State.FinishedAt && !data.State.FinishedAt.startsWith('0001-01-01') ? data.State.FinishedAt : '',
318
+ status: data.State && data.State.Health && data.State.Health.Status ? data.State.Health.Status : '',
318
319
  state: payload.State,
319
320
  restartCount: data.RestartCount || 0,
320
321
  platform: data.Platform || '',
package/lib/index.d.ts CHANGED
@@ -5,7 +5,6 @@
5
5
  /// <reference types="node" />
6
6
 
7
7
  export namespace Systeminformation {
8
-
9
8
  // 1. General
10
9
 
11
10
  interface TimeData {
@@ -225,7 +224,7 @@ export namespace Systeminformation {
225
224
  nvme_pci_vendor?: {
226
225
  id: number;
227
226
  subsystem_id: number;
228
- },
227
+ };
229
228
  nvme_smart_health_information_log?: {
230
229
  critical_warning?: number;
231
230
  temperature?: number;
@@ -245,11 +244,11 @@ export namespace Systeminformation {
245
244
  warning_temp_time?: number;
246
245
  critical_comp_time?: number;
247
246
  temperature_sensors?: number[];
248
- },
247
+ };
249
248
  user_capacity?: {
250
249
  blocks: number;
251
250
  bytes: number;
252
- },
251
+ };
253
252
  logical_block_size?: number;
254
253
  temperature: {
255
254
  current: number;
@@ -758,6 +757,7 @@ export namespace Systeminformation {
758
757
  createdAt: string;
759
758
  startedAt: string;
760
759
  finishedAt: string;
760
+ status: string;
761
761
  state: string;
762
762
  restartCount: number;
763
763
  platform: string;
@@ -997,10 +997,7 @@ export function networkInterfaces(): Promise<Systeminformation.NetworkInterfaces
997
997
  export function networkInterfaces(defaultString: 'default'): Promise<Systeminformation.NetworkInterfacesData>;
998
998
  export function networkInterfaces(rescan: boolean): Promise<Systeminformation.NetworkInterfacesData[]>;
999
999
  export function networkInterfaces(
1000
- cb:
1001
- | ((data: Systeminformation.NetworkInterfacesData[] | Systeminformation.NetworkInterfacesData) => any)
1002
- | boolean
1003
- | string,
1000
+ cb: ((data: Systeminformation.NetworkInterfacesData[] | Systeminformation.NetworkInterfacesData) => any) | boolean | string,
1004
1001
  rescan?: boolean,
1005
1002
  defaultString?: string
1006
1003
  ): Promise<Systeminformation.NetworkInterfacesData[] | Systeminformation.NetworkInterfacesData>;
package/lib/network.js CHANGED
@@ -1321,17 +1321,18 @@ function networkStatsSingle(iface) {
1321
1321
  if (sections[i].trim() !== '') {
1322
1322
  const lines = sections[i].trim().split('\r\n');
1323
1323
  perfData.push({
1324
- name: util
1325
- .getValue(lines, 'Name', ':')
1324
+ name: util.getValue(lines, 'Name', ':').toLowerCase(),
1325
+ desc: util
1326
+ .getValue(lines, 'InterfaceDescription', ':')
1326
1327
  .replace(/[()[\] ]+/g, '')
1327
1328
  .replace(/#|\//g, '_')
1328
1329
  .toLowerCase(),
1329
- rx_bytes: parseInt(util.getValue(lines, 'BytesReceivedPersec', ':'), 10),
1330
- rx_errors: parseInt(util.getValue(lines, 'PacketsReceivedErrors', ':'), 10),
1331
- rx_dropped: parseInt(util.getValue(lines, 'PacketsReceivedDiscarded', ':'), 10),
1332
- tx_bytes: parseInt(util.getValue(lines, 'BytesSentPersec', ':'), 10),
1333
- tx_errors: parseInt(util.getValue(lines, 'PacketsOutboundErrors', ':'), 10),
1334
- tx_dropped: parseInt(util.getValue(lines, 'PacketsOutboundDiscarded', ':'), 10)
1330
+ rx_bytes: parseInt(util.getValue(lines, 'ReceivedBytes', ':'), 10),
1331
+ rx_errors: parseInt(util.getValue(lines, 'ReceivedPacketErrors', ':'), 10),
1332
+ rx_dropped: parseInt(util.getValue(lines, 'ReceivedDiscardedPackets', ':'), 10),
1333
+ tx_bytes: parseInt(util.getValue(lines, 'SentBytes', ':'), 10),
1334
+ tx_errors: parseInt(util.getValue(lines, 'OutboundPacketErrors', ':'), 10),
1335
+ tx_dropped: parseInt(util.getValue(lines, 'OutboundDiscardedPackets', ':'), 10)
1335
1336
  });
1336
1337
  }
1337
1338
  }
@@ -1480,7 +1481,7 @@ function networkStatsSingle(iface) {
1480
1481
  // Performance Data
1481
1482
  util
1482
1483
  .powerShell(
1483
- 'Get-CimInstance Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl'
1484
+ 'Get-NetAdapterStatistics | select Name,InterfaceDescription,ReceivedBytes,ReceivedPacketErrors,ReceivedDiscardedPackets,SentBytes,OutboundPacketErrors,OutboundDiscardedPackets | fl'
1484
1485
  )
1485
1486
  .then((stdout, error) => {
1486
1487
  if (!error) {
@@ -1508,10 +1509,11 @@ function networkStatsSingle(iface) {
1508
1509
  .replace(/[()[\] ]+/g, '')
1509
1510
  .replace('#', '_')
1510
1511
  .toLowerCase()) &&
1511
- det.ifaceName
1512
- .replace(/[()[\] ]+/g, '')
1513
- .replace(/#|\//g, '_')
1514
- .toLowerCase() === detail.name
1512
+ (det.iface.toLowerCase() === detail.name ||
1513
+ det.ifaceName
1514
+ .replace(/[()[\] ]+/g, '')
1515
+ .replace(/#|\//g, '_')
1516
+ .toLowerCase() === detail.desc)
1515
1517
  ) {
1516
1518
  ifaceName = det.iface;
1517
1519
  rx_bytes = detail.rx_bytes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.32.0",
3
+ "version": "5.33.1",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",