systeminformation 5.21.3 → 5.21.5

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
@@ -29,11 +29,11 @@
29
29
  [![MIT license][license-img]][license-url]
30
30
 
31
31
  ## The Systeminformation Project
32
- This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 600 versions published, up to 6 mio downloads per month, > 150 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
32
+ This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 600 versions published, up to 8 mio downloads per month, > 200 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
33
33
 
34
34
  ## Please support this project ... ☕️
35
35
 
36
- Over the past few years I spent **over 2.000 hours** working on this project and invested in hardware to be able to test on different platforms. Currently I am working very hard on the next **new version 6.0** completely rewritten in TypeScript and with a lot of new features. Any support is highly appreciated - [Buy me a coffee](https://www.buymeacoffee.com/systeminfo).
36
+ Over the past few years I spent **more than 2.000 hours** working on this project and invested in hardware to be able to test on different platforms. Currently I am working very hard on the next **new version 6.0** completely rewritten in TypeScript and with a lot of new features. Any support is highly appreciated - [Buy me a coffee](https://www.buymeacoffee.com/systeminfo).
37
37
 
38
38
  **Your contribution** make it possible for me to keep working on this project, add new features and support more platforms. Thank you in advance!
39
39
 
package/lib/system.js CHANGED
@@ -317,6 +317,12 @@ function system(callback) {
317
317
 
318
318
  exports.system = system;
319
319
 
320
+ function cleanDefaults(s) {
321
+ if (s === 'Default string') { s = ''; }
322
+ if (s.toLowerCase().indexOf('o.e.m.') !== -1) { s = ''; }
323
+
324
+ return s
325
+ }
320
326
  function bios(callback) {
321
327
 
322
328
  return new Promise((resolve) => {
@@ -418,7 +424,7 @@ function bios(callback) {
418
424
  }
419
425
  result.releaseDate = util.getValue(lines, 'releasedate', ':');
420
426
  result.revision = util.getValue(lines, 'buildnumber', ':');
421
- result.serial = util.getValue(lines, 'serialnumber', ':');
427
+ result.serial = cleanDefaults(util.getValue(lines, 'serialnumber', ':'));
422
428
  }
423
429
 
424
430
  if (callback) { callback(result); }
@@ -555,23 +561,26 @@ function baseboard(callback) {
555
561
  const workload = [];
556
562
  const win10plus = parseInt(os.release()) >= 10;
557
563
  const maxCapacityAttribute = win10plus ? 'MaxCapacityEx' : 'MaxCapacity';
558
- workload.push(util.powerShell('Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl'));
564
+ workload.push(util.powerShell('Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl'));
559
565
  workload.push(util.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${maxCapacityAttribute}, MemoryDevices | fl`));
560
566
  util.promiseAll(
561
567
  workload
562
568
  ).then((data) => {
563
569
  let lines = data.results[0] ? data.results[0].toString().split('\r\n') : [''];
564
570
 
565
- result.manufacturer = util.getValue(lines, 'manufacturer', ':');
566
- result.model = util.getValue(lines, 'model', ':');
571
+ result.manufacturer = cleanDefaults(util.getValue(lines, 'manufacturer', ':'));
572
+ result.model = cleanDefaults(util.getValue(lines, 'model', ':'));
567
573
  if (!result.model) {
568
- result.model = util.getValue(lines, 'product', ':');
574
+ result.model = cleanDefaults(util.getValue(lines, 'product', ':'));
575
+ }
576
+ result.version = cleanDefaults(util.getValue(lines, 'version', ':'));
577
+ result.serial = cleanDefaults(util.getValue(lines, 'serialnumber', ':'));
578
+ result.assetTag = cleanDefaults(util.getValue(lines, 'partnumber', ':'));
579
+ if (!result.assetTag) {
580
+ result.assetTag = cleanDefaults(util.getValue(lines, 'sku', ':'));
569
581
  }
570
- result.version = util.getValue(lines, 'version', ':');
571
- result.serial = util.getValue(lines, 'serialnumber', ':');
572
- result.assetTag = util.getValue(lines, 'partnumber', ':');
573
582
  if (!result.assetTag) {
574
- result.assetTag = util.getValue(lines, 'sku', ':');
583
+ result.assetTag = cleanDefaults(util.getValue(lines, 'SMBIOSAssetTag', ':'));
575
584
  }
576
585
 
577
586
  // memphysical
@@ -688,22 +697,21 @@ function chassis(callback) {
688
697
  }
689
698
  if (_windows) {
690
699
  try {
691
- util.powerShell('Get-CimInstance Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU | fl').then((stdout, error) => {
700
+ util.powerShell('Get-CimInstance Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl').then((stdout, error) => {
692
701
  if (!error) {
693
702
  let lines = stdout.toString().split('\r\n');
694
703
 
695
- result.manufacturer = util.getValue(lines, 'manufacturer', ':');
696
- result.model = util.getValue(lines, 'model', ':');
704
+ result.manufacturer = cleanDefaults(util.getValue(lines, 'manufacturer', ':'));
705
+ result.model = cleanDefaults(util.getValue(lines, 'model', ':'));
697
706
  const ctype = parseInt(util.getValue(lines, 'ChassisTypes', ':').replace(/\D/g, ''));
698
707
  result.type = (ctype && !isNaN(ctype) && ctype < chassisTypes.length) ? chassisTypes[ctype - 1] : '';
699
- result.version = util.getValue(lines, 'version', ':');
700
- result.serial = util.getValue(lines, 'serialnumber', ':');
701
- result.assetTag = util.getValue(lines, 'partnumber', ':');
702
- result.sku = util.getValue(lines, 'sku', ':');
703
- if (result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) { result.manufacturer = '-'; }
704
- if (result.version.toLowerCase().indexOf('o.e.m.') !== -1) { result.version = '-'; }
705
- if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; }
706
- if (result.assetTag.toLowerCase().indexOf('o.e.m.') !== -1) { result.assetTag = '-'; }
708
+ result.version = cleanDefaults(util.getValue(lines, 'version', ':'));
709
+ result.serial = cleanDefaults(util.getValue(lines, 'serialnumber', ':'));
710
+ result.assetTag = cleanDefaults(util.getValue(lines, 'partnumber', ':'));
711
+ if (!result.assetTag) {
712
+ result.assetTag = cleanDefaults(util.getValue(lines, 'SMBIOSAssetTag', ':'));
713
+ }
714
+ result.sku = cleanDefaults(util.getValue(lines, 'sku', ':'));
707
715
  }
708
716
 
709
717
  if (callback) { callback(result); }
package/lib/wifi.js CHANGED
@@ -598,6 +598,11 @@ function wifiConnections(callback) {
598
598
  }
599
599
  resolve(result);
600
600
  });
601
+ } else {
602
+ if (callback) {
603
+ callback(result);
604
+ }
605
+ resolve(result);
601
606
  }
602
607
  });
603
608
  } else if (_windows) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.21.3",
3
+ "version": "5.21.5",
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)",