systeminformation 5.25.1 → 5.25.2

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
@@ -178,7 +178,7 @@ si.cpu()
178
178
 
179
179
  (last 7 major and minor version releases)
180
180
 
181
- - Version 5.24.0: `versions()` added homebrew
181
+ - Version 5.25.0: `versions()` added homebrew
182
182
  - Version 5.24.0: `versions()` added bun and deno
183
183
  - Version 5.23.0: `usb()` added serial number (linux)
184
184
  - Version 5.22.0: `wifiConnections()` added signal quality
package/lib/battery.js CHANGED
@@ -181,7 +181,7 @@ module.exports = function (callback) {
181
181
  }
182
182
 
183
183
  if (_darwin) {
184
- exec('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|BatterySerialNumber|TimeRemaining|Voltage"; pmset -g batt | grep %', function (error, stdout) {
184
+ exec('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|DeviceName|BatterySerialNumber|Serial|TimeRemaining|Voltage"; pmset -g batt | grep %', function (error, stdout) {
185
185
  if (stdout) {
186
186
  let lines = stdout.toString().replace(/ +/g, '').replace(/"+/g, '').replace(/-/g, '').split('\n');
187
187
  result.cycleCount = parseInt('0' + util.getValue(lines, 'cyclecount', '='), 10);
@@ -191,7 +191,8 @@ module.exports = function (callback) {
191
191
  result.currentCapacity = Math.round(parseInt('0' + util.getValue(lines, 'applerawcurrentcapacity', '='), 10) * (result.voltage || 1));
192
192
  result.designedCapacity = Math.round(parseInt('0' + util.getValue(lines, 'DesignCapacity', '='), 10) * (result.voltage || 1));
193
193
  result.manufacturer = 'Apple';
194
- result.serial = util.getValue(lines, 'BatterySerialNumber', '=');
194
+ result.serial = util.getValue(lines, 'BatterySerialNumber', '=') || util.getValue(lines, 'Serial', '=');
195
+ result.model = util.getValue(lines, 'DeviceName', '=');
195
196
  let percent = null;
196
197
  const line = util.getValue(lines, 'internal', 'Battery');
197
198
  let parts = line.split(';');
package/lib/cpu.js CHANGED
@@ -1019,7 +1019,7 @@ function getCpuCurrentSpeedSync() {
1019
1019
  if (speeds[i] < minFreq) { minFreq = speeds[i]; }
1020
1020
  cores.push(parseFloat(speeds[i].toFixed(2)));
1021
1021
  }
1022
- avgFreq = avgFreq / cpus.length;
1022
+ avgFreq = avgFreq / speeds.length;
1023
1023
  return {
1024
1024
  min: parseFloat(minFreq.toFixed(2)),
1025
1025
  max: parseFloat(maxFreq.toFixed(2)),
package/lib/system.js CHANGED
@@ -48,11 +48,11 @@ function system(callback) {
48
48
  if (_linux || _freebsd || _openbsd || _netbsd) {
49
49
  exec('export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL', function (error, stdout) {
50
50
  let lines = stdout.toString().split('\n');
51
- result.manufacturer = util.getValue(lines, 'manufacturer');
52
- result.model = util.getValue(lines, 'product name');
51
+ result.manufacturer = cleanDefaults(util.getValue(lines, 'manufacturer'));
52
+ result.model = cleanDefaults(util.getValue(lines, 'product name'));
53
53
  result.version = cleanDefaults(util.getValue(lines, 'version'));
54
54
  result.serial = cleanDefaults(util.getValue(lines, 'serial number'));
55
- result.uuid = cleanDefaults((util.getValue(lines, 'uuid').toLowerCase()));
55
+ result.uuid = cleanDefaults((util.getValue(lines, 'uuid'))).toLowerCase();
56
56
  result.sku = cleanDefaults(util.getValue(lines, 'sku number'));
57
57
  // Non-Root values
58
58
  const cmd = `echo -n "product_name: "; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;
@@ -62,8 +62,8 @@ function system(callback) {
62
62
  echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`;
63
63
  try {
64
64
  lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
65
- result.manufacturer = result.manufacturer === '' ? util.getValue(lines, 'sys_vendor') : result.manufacturer;
66
- result.model = result.model === '' ? util.getValue(lines, 'product_name') : result.model;
65
+ result.manufacturer = cleanDefaults(result.manufacturer === '' ? util.getValue(lines, 'sys_vendor') : result.manufacturer);
66
+ result.model = cleanDefaults(result.model === '' ? util.getValue(lines, 'product_name') : result.model);
67
67
  result.version = cleanDefaults(result.version === '' ? util.getValue(lines, 'product_version') : result.version);
68
68
  result.serial = cleanDefaults(result.serial === '' ? util.getValue(lines, 'product_serial') : result.serial);
69
69
  result.uuid = cleanDefaults(result.uuid === '' ? util.getValue(lines, 'product_uuid').toLowerCase() : result.uuid);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.25.1",
3
+ "version": "5.25.2",
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)",