systeminformation 5.17.10 → 5.17.12

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,7 +29,7 @@
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, > 500 versions published, up to 6 mio downloads per month, > 130 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, > 500 versions published, up to 6 mio downloads per month, > 140 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
33
33
 
34
34
  ## New Version 5.0
35
35
 
package/lib/filesystem.js CHANGED
@@ -382,6 +382,8 @@ function parseBlk(lines) {
382
382
 
383
383
  function decodeMdabmData(lines) {
384
384
  const raid = util.getValue(lines, 'md_level', '=');
385
+ const label = util.getValue(lines, 'md_name', '='); // <- get label info
386
+ const uuid = util.getValue(lines, 'md_uuid', '='); // <- get uuid info
385
387
  const members = [];
386
388
  lines.forEach(line => {
387
389
  if (line.toLowerCase().startsWith('md_device_dev') && line.toLowerCase().indexOf('/dev/') > 0) {
@@ -390,6 +392,8 @@ function decodeMdabmData(lines) {
390
392
  });
391
393
  return {
392
394
  raid,
395
+ label,
396
+ uuid,
393
397
  members
394
398
  };
395
399
  }
@@ -402,6 +406,10 @@ function raidMatchLinux(data) {
402
406
  if (element.type.startsWith('raid')) {
403
407
  const lines = execSync(`mdadm --export --detail /dev/${element.name}`).toString().split('\n');
404
408
  const mdData = decodeMdabmData(lines);
409
+
410
+ element.label = mdData.label; // <- assign label info
411
+ element.uuid = mdData.uuid; // <- assign uuid info
412
+
405
413
  if (mdData.members && mdData.members.length && mdData.raid === element.type) {
406
414
  result = result.map(blockdevice => {
407
415
  if (blockdevice.fsType === 'linux_raid_member' && mdData.members.indexOf(blockdevice.name) >= 0) {
package/lib/osinfo.js CHANGED
@@ -1047,25 +1047,29 @@ function shell(callback) {
1047
1047
  exports.shell = shell;
1048
1048
 
1049
1049
  function getUniqueMacAdresses() {
1050
- const ifaces = os.networkInterfaces();
1051
1050
  let macs = [];
1052
- for (let dev in ifaces) {
1053
- if ({}.hasOwnProperty.call(ifaces, dev)) {
1054
- ifaces[dev].forEach(function (details) {
1055
- if (details && details.mac && details.mac !== '00:00:00:00:00:00') {
1056
- const mac = details.mac.toLowerCase();
1057
- if (macs.indexOf(mac) === -1) {
1058
- macs.push(mac);
1051
+ try {
1052
+ const ifaces = os.networkInterfaces();
1053
+ for (let dev in ifaces) {
1054
+ if ({}.hasOwnProperty.call(ifaces, dev)) {
1055
+ ifaces[dev].forEach(function (details) {
1056
+ if (details && details.mac && details.mac !== '00:00:00:00:00:00') {
1057
+ const mac = details.mac.toLowerCase();
1058
+ if (macs.indexOf(mac) === -1) {
1059
+ macs.push(mac);
1060
+ }
1059
1061
  }
1060
- }
1061
- });
1062
+ });
1063
+ }
1062
1064
  }
1065
+ macs = macs.sort(function (a, b) {
1066
+ if (a < b) { return -1; }
1067
+ if (a > b) { return 1; }
1068
+ return 0;
1069
+ });
1070
+ } catch (e) {
1071
+ macs.push('00:00:00:00:00:00');
1063
1072
  }
1064
- macs = macs.sort(function (a, b) {
1065
- if (a < b) { return -1; }
1066
- if (a > b) { return 1; }
1067
- return 0;
1068
- });
1069
1073
  return macs;
1070
1074
  }
1071
1075
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.17.10",
3
+ "version": "5.17.12",
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)",