systeminformation 5.16.5 → 5.16.7

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/lib/printer.js CHANGED
@@ -190,7 +190,7 @@ function printer(callback) {
190
190
  for (let i = 0; i < parts.length; i++) {
191
191
  const printer = parseWindowsPrinters(parts[i].split('\n'), i);
192
192
  if (printer.name || printer.model) {
193
- result.push(parseWindowsPrinters(parts[i].split('\n'), i));
193
+ result.push(printer);
194
194
  }
195
195
  }
196
196
  }
package/lib/processes.js CHANGED
@@ -653,12 +653,12 @@ function processes(callback) {
653
653
  function parseProcesses2(lines) {
654
654
 
655
655
  function formatDateTime(time) {
656
- const month = ('0' + (time.getMonth() + 1).toString()).substr(-2);
656
+ const month = ('0' + (time.getMonth() + 1).toString()).slice(-2);
657
657
  const year = time.getFullYear().toString();
658
- const day = ('0' + time.getDate().toString()).substr(-2);
659
- const hours = time.getHours().toString();
660
- const mins = time.getMinutes().toString();
661
- const secs = ('0' + time.getSeconds().toString()).substr(-2);
658
+ const day = ('0' + time.getDate().toString()).slice(-2);
659
+ const hours = ('0' + time.getHours().toString()).slice(-2);
660
+ const mins = ('0' + time.getMinutes().toString()).slice(-2);
661
+ const secs = ('0' + time.getSeconds().toString()).slice(-2);
662
662
 
663
663
  return (year + '-' + month + '-' + day + ' ' + hours + ':' + mins + ':' + secs);
664
664
  }
@@ -847,7 +847,7 @@ function processes(callback) {
847
847
  let additionalCommand = false;
848
848
  lines.forEach((line) => {
849
849
  if (additionalCommand && line.toLowerCase().startsWith(' ')) {
850
- commandLine = commandLine + line.trim();
850
+ commandLine += ' ' + line.trim();
851
851
  } else {
852
852
  additionalCommand = false;
853
853
  }
package/lib/util.js CHANGED
@@ -28,7 +28,6 @@ const _windows = (_platform === 'win32');
28
28
  const _freebsd = (_platform === 'freebsd');
29
29
  const _openbsd = (_platform === 'openbsd');
30
30
  const _netbsd = (_platform === 'netbsd');
31
- // const _sunos = (_platform === 'sunos');
32
31
 
33
32
  let _cores = 0;
34
33
  let wmicPath = '';
@@ -288,7 +287,7 @@ function parseHead(head, rights) {
288
287
  cap: head.substring(from, to)
289
288
  });
290
289
  let len = result.length;
291
- for (var i = 0; i < len; i++) {
290
+ for (let i = 0; i < len; i++) {
292
291
  if (result[i].cap.replace(/\s/g, '').length === 0) {
293
292
  if (i + 1 < len) {
294
293
  result[i].to = result[i + 1].to;
@@ -343,21 +342,6 @@ function wmic(command) {
343
342
  });
344
343
  }
345
344
 
346
- // function wmic(command, options) {
347
- // options = options || execOptsWin;
348
- // return new Promise((resolve) => {
349
- // process.nextTick(() => {
350
- // try {
351
- // exec(WINDIR + '\\system32\\chcp.com 65001 | ' + getWmic() + ' ' + command, options, function (error, stdout) {
352
- // resolve(stdout, error);
353
- // }).stdin.end();
354
- // } catch (e) {
355
- // resolve('', e);
356
- // }
357
- // });
358
- // });
359
- // }
360
-
361
345
  function getVboxmanage() {
362
346
  return _windows ? `"${process.env.VBOX_INSTALL_PATH || process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"` : 'vboxmanage';
363
347
  }
@@ -384,8 +368,6 @@ function powerShellProceedResults(data) {
384
368
  for (let i = 0; i < _psCmds.length; i++) {
385
369
  if (_psCmds[i].id === id) {
386
370
  remove = i;
387
- // console.log(`----- TIME : ${(new Date() - _psCmds[i].start) * 0.001} s`);
388
-
389
371
  _psCmds[i].callback(res);
390
372
  }
391
373
  }
@@ -469,7 +451,6 @@ function powerShell(cmd) {
469
451
  return new Promise((resolve) => {
470
452
  process.nextTick(() => {
471
453
  try {
472
- // const start = new Date();
473
454
  const child = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-'], {
474
455
  stdio: 'pipe',
475
456
  windowsHide: true,
@@ -493,7 +474,6 @@ function powerShell(cmd) {
493
474
  });
494
475
  child.on('close', function () {
495
476
  child.kill();
496
- // console.log(`----- TIME : ${(new Date() - start) * 0.001} s`);
497
477
 
498
478
  resolve(result);
499
479
  });
@@ -1014,7 +994,6 @@ function decodePiCpuinfo(lines) {
1014
994
  } else {
1015
995
  // new revision code
1016
996
  const revision = ('00000000' + getValue(lines, 'revision', ':', true).toLowerCase()).substr(-8);
1017
- // const revisionStyleNew = hex2bin(revision.substr(2, 1)).substr(4, 1) === '1';
1018
997
  const memSizeCode = parseInt(hex2bin(revision.substr(2, 1)).substr(5, 3), 2) || 0;
1019
998
  const manufacturer = manufacturerList[parseInt(revision.substr(3, 1), 10)];
1020
999
  const processor = processorList[parseInt(revision.substr(4, 1), 10)];
@@ -1038,7 +1017,7 @@ function decodePiCpuinfo(lines) {
1038
1017
  function promiseAll(promises) {
1039
1018
  const resolvingPromises = promises.map(function (promise) {
1040
1019
  return new Promise(function (resolve) {
1041
- var payload = new Array(2);
1020
+ let payload = new Array(2);
1042
1021
  promise.then(function (result) {
1043
1022
  payload[0] = result;
1044
1023
  })
@@ -1051,8 +1030,8 @@ function promiseAll(promises) {
1051
1030
  });
1052
1031
  });
1053
1032
  });
1054
- var errors = [];
1055
- var results = [];
1033
+ const errors = [];
1034
+ const results = [];
1056
1035
 
1057
1036
  // Execute all wrapped Promises
1058
1037
  return Promise.all(resolvingPromises)
@@ -1076,7 +1055,7 @@ function promiseAll(promises) {
1076
1055
 
1077
1056
  function promisify(nodeStyleFunction) {
1078
1057
  return function () {
1079
- var args = Array.prototype.slice.call(arguments);
1058
+ const args = Array.prototype.slice.call(arguments);
1080
1059
  return new Promise(function (resolve, reject) {
1081
1060
  args.push(function (err, data) {
1082
1061
  if (err) {
@@ -1092,7 +1071,7 @@ function promisify(nodeStyleFunction) {
1092
1071
 
1093
1072
  function promisifySave(nodeStyleFunction) {
1094
1073
  return function () {
1095
- var args = Array.prototype.slice.call(arguments);
1074
+ const args = Array.prototype.slice.call(arguments);
1096
1075
  return new Promise(function (resolve) {
1097
1076
  args.push(function (err, data) {
1098
1077
  resolve(data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.16.5",
3
+ "version": "5.16.7",
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)",