systeminformation 5.16.6 → 5.16.8
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 +1 -1
- package/lib/processes.js +1 -1
- package/lib/util.js +8 -29
- package/package.json +1 -1
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(
|
|
193
|
+
result.push(printer);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
}
|
package/lib/processes.js
CHANGED
|
@@ -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
|
|
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 = '';
|
|
@@ -281,14 +280,14 @@ function parseHead(head, rights) {
|
|
|
281
280
|
space = head[i] === ' ';
|
|
282
281
|
}
|
|
283
282
|
}
|
|
284
|
-
to =
|
|
283
|
+
to = 5000;
|
|
285
284
|
result.push({
|
|
286
285
|
from: from,
|
|
287
286
|
to: to,
|
|
288
287
|
cap: head.substring(from, to)
|
|
289
288
|
});
|
|
290
289
|
let len = result.length;
|
|
291
|
-
for (
|
|
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
|
}
|
|
@@ -441,7 +423,7 @@ function powerShellRelease() {
|
|
|
441
423
|
function powerShell(cmd) {
|
|
442
424
|
|
|
443
425
|
if (_psPersistent) {
|
|
444
|
-
const id = Math.random().toString(36).
|
|
426
|
+
const id = Math.random().toString(36).substring(2, 12);
|
|
445
427
|
return new Promise((resolve) => {
|
|
446
428
|
process.nextTick(() => {
|
|
447
429
|
function callback(data) {
|
|
@@ -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
|
-
|
|
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
|
-
|
|
1055
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "5.16.8",
|
|
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)",
|