systeminformation 5.9.6 → 5.9.10
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 +5 -0
- package/lib/audio.js +219 -219
- package/lib/battery.js +309 -309
- package/lib/bluetooth.js +183 -183
- package/lib/cpu.js +87 -56
- package/lib/docker.js +6 -1
- package/lib/dockerSocket.js +1 -1
- package/lib/filesystem.js +79 -74
- package/lib/graphics.js +44 -45
- package/lib/index.d.ts +60 -24
- package/lib/memory.js +31 -28
- package/lib/network.js +192 -106
- package/lib/osinfo.js +14 -15
- package/lib/printer.js +212 -212
- package/lib/processes.js +1240 -1240
- package/lib/system.js +40 -40
- package/lib/usb.js +305 -305
- package/lib/users.js +192 -81
- package/lib/util.js +23 -7
- package/lib/wifi.js +15 -8
- package/package.json +1 -1
- package/CHANGELOG.md +0 -679
package/lib/system.js
CHANGED
|
@@ -122,14 +122,12 @@ function system(callback) {
|
|
|
122
122
|
util.noop();
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
if (!result.virtual && (
|
|
126
|
-
|
|
127
|
-
versionStr = versionStr.split('-')[0].replace('#', '');
|
|
128
|
-
const version = os.release().toLowerCase().endsWith('wsl2') ? 'WSL2' : parseInt(versionStr, 10) || null;
|
|
125
|
+
if (!result.virtual && (os.release().toLowerCase().indexOf('microsoft') >= 0 || os.release().toLowerCase().endsWith('wsl2'))) {
|
|
126
|
+
const kernelVersion = parseFloat(os.release().toLowerCase());
|
|
129
127
|
result.virtual = true;
|
|
130
128
|
result.manufacturer = 'Microsoft';
|
|
131
129
|
result.model = 'WSL';
|
|
132
|
-
result.version =
|
|
130
|
+
result.version = kernelVersion < 4.19 ? '1' : '2';
|
|
133
131
|
}
|
|
134
132
|
if ((_freebsd || _openbsd || _netbsd) && !result.virtualHost) {
|
|
135
133
|
try {
|
|
@@ -345,15 +343,15 @@ function system(callback) {
|
|
|
345
343
|
}
|
|
346
344
|
if (_windows) {
|
|
347
345
|
try {
|
|
348
|
-
util.
|
|
346
|
+
util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | fl *').then((stdout, error) => {
|
|
349
347
|
if (!error) {
|
|
350
348
|
// let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0)[0].trim().split(/\s\s+/);
|
|
351
349
|
let lines = stdout.split('\r\n');
|
|
352
|
-
result.manufacturer = util.getValue(lines, 'vendor', '
|
|
353
|
-
result.model = util.getValue(lines, 'name', '
|
|
354
|
-
result.version = util.getValue(lines, 'version', '
|
|
355
|
-
result.serial = util.getValue(lines, 'identifyingnumber', '
|
|
356
|
-
result.uuid = util.getValue(lines, 'uuid', '
|
|
350
|
+
result.manufacturer = util.getValue(lines, 'vendor', ':');
|
|
351
|
+
result.model = util.getValue(lines, 'name', ':');
|
|
352
|
+
result.version = util.getValue(lines, 'version', ':');
|
|
353
|
+
result.serial = util.getValue(lines, 'identifyingnumber', ':');
|
|
354
|
+
result.uuid = util.getValue(lines, 'uuid', ':').toLowerCase();
|
|
357
355
|
// detect virtual (1)
|
|
358
356
|
if (result.model.toLowerCase() === 'virtualbox' || result.model.toLowerCase() === 'kvm' || result.model.toLowerCase() === 'virtual machine' || result.model.toLowerCase() === 'bochs' || result.model.toLowerCase().startsWith('vmware')) {
|
|
359
357
|
result.virtual = true;
|
|
@@ -383,13 +381,13 @@ function system(callback) {
|
|
|
383
381
|
break;
|
|
384
382
|
}
|
|
385
383
|
}
|
|
386
|
-
util.
|
|
384
|
+
util.powerShell('Get-WmiObject MS_Systeminformation -Namespace "root/wmi" | fl *').then((stdout, error) => {
|
|
387
385
|
if (!error) {
|
|
388
386
|
let lines = stdout.split('\r\n');
|
|
389
|
-
result.sku = util.getValue(lines, 'systemsku', '
|
|
387
|
+
result.sku = util.getValue(lines, 'systemsku', ':');
|
|
390
388
|
}
|
|
391
389
|
if (!result.virtual) {
|
|
392
|
-
util.
|
|
390
|
+
util.powerShell('Get-WmiObject Win32_bios | select Version, SerialNumber, SMBIOSBIOSVersion').then((stdout, error) => {
|
|
393
391
|
if (!error) {
|
|
394
392
|
let lines = stdout.toString();
|
|
395
393
|
if (lines.indexOf('VRTUAL') >= 0 || lines.indexOf('A M I ') >= 0 || lines.indexOf('VirtualBox') >= 0 || lines.indexOf('VMWare') >= 0 || lines.indexOf('Xen') >= 0) {
|
|
@@ -463,6 +461,7 @@ function bios(callback) {
|
|
|
463
461
|
let datetime = util.getValue(lines, 'Release Date');
|
|
464
462
|
result.releaseDate = util.parseDateTime(datetime).date;
|
|
465
463
|
result.revision = util.getValue(lines, 'BIOS Revision');
|
|
464
|
+
result.serial = util.getValue(lines, 'SerialNumber');
|
|
466
465
|
let language = util.getValue(lines, 'Currently Installed Language').split('|')[0];
|
|
467
466
|
if (language) {
|
|
468
467
|
result.language = language;
|
|
@@ -519,27 +518,28 @@ function bios(callback) {
|
|
|
519
518
|
}
|
|
520
519
|
if (_windows) {
|
|
521
520
|
try {
|
|
522
|
-
util.
|
|
521
|
+
util.powerShell('Get-WmiObject Win32_bios | fl *').then((stdout, error) => {
|
|
523
522
|
if (!error) {
|
|
524
523
|
let lines = stdout.toString().split('\r\n');
|
|
525
|
-
const description = util.getValue(lines, 'description', '
|
|
524
|
+
const description = util.getValue(lines, 'description', ':');
|
|
526
525
|
if (description.indexOf(' Version ') !== -1) {
|
|
527
526
|
// ... Phoenix ROM BIOS PLUS Version 1.10 A04
|
|
528
527
|
result.vendor = description.split(' Version ')[0].trim();
|
|
529
528
|
result.version = description.split(' Version ')[1].trim();
|
|
530
529
|
} else if (description.indexOf(' Ver: ') !== -1) {
|
|
531
530
|
// ... BIOS Date: 06/27/16 17:50:16 Ver: 1.4.5
|
|
532
|
-
result.vendor = util.getValue(lines, 'manufacturer', '
|
|
531
|
+
result.vendor = util.getValue(lines, 'manufacturer', ':');
|
|
533
532
|
result.version = description.split(' Ver: ')[1].trim();
|
|
534
533
|
} else {
|
|
535
|
-
result.vendor = util.getValue(lines, 'manufacturer', '
|
|
536
|
-
result.version = util.getValue(lines, 'version', '
|
|
534
|
+
result.vendor = util.getValue(lines, 'manufacturer', ':');
|
|
535
|
+
result.version = util.getValue(lines, 'version', ':');
|
|
537
536
|
}
|
|
538
|
-
result.releaseDate = util.getValue(lines, 'releasedate', '
|
|
537
|
+
result.releaseDate = util.getValue(lines, 'releasedate', ':');
|
|
539
538
|
if (result.releaseDate.length >= 10) {
|
|
540
539
|
result.releaseDate = result.releaseDate.substr(0, 4) + '-' + result.releaseDate.substr(4, 2) + '-' + result.releaseDate.substr(6, 2);
|
|
541
540
|
}
|
|
542
|
-
result.revision = util.getValue(lines, 'buildnumber', '
|
|
541
|
+
result.revision = util.getValue(lines, 'buildnumber', ':');
|
|
542
|
+
result.serial = util.getValue(lines, 'serialnumber', ':');
|
|
543
543
|
}
|
|
544
544
|
|
|
545
545
|
if (callback) { callback(result); }
|
|
@@ -674,29 +674,29 @@ function baseboard(callback) {
|
|
|
674
674
|
if (_windows) {
|
|
675
675
|
try {
|
|
676
676
|
const workload = [];
|
|
677
|
-
workload.push(util.
|
|
678
|
-
workload.push(util.
|
|
677
|
+
workload.push(util.powerShell('Get-WmiObject Win32_baseboard | fl *'));
|
|
678
|
+
workload.push(util.powerShell('Get-WmiObject Win32_physicalmemoryarray | select MaxCapacity, MemoryDevices | fl'));
|
|
679
679
|
util.promiseAll(
|
|
680
680
|
workload
|
|
681
681
|
).then(data => {
|
|
682
682
|
let lines = data.results[0] ? data.results[0].toString().split('\r\n') : [''];
|
|
683
683
|
|
|
684
|
-
result.manufacturer = util.getValue(lines, 'manufacturer', '
|
|
685
|
-
result.model = util.getValue(lines, 'model', '
|
|
684
|
+
result.manufacturer = util.getValue(lines, 'manufacturer', ':');
|
|
685
|
+
result.model = util.getValue(lines, 'model', ':');
|
|
686
686
|
if (!result.model) {
|
|
687
|
-
result.model = util.getValue(lines, 'product', '
|
|
687
|
+
result.model = util.getValue(lines, 'product', ':');
|
|
688
688
|
}
|
|
689
|
-
result.version = util.getValue(lines, 'version', '
|
|
690
|
-
result.serial = util.getValue(lines, 'serialnumber', '
|
|
691
|
-
result.assetTag = util.getValue(lines, 'partnumber', '
|
|
689
|
+
result.version = util.getValue(lines, 'version', ':');
|
|
690
|
+
result.serial = util.getValue(lines, 'serialnumber', ':');
|
|
691
|
+
result.assetTag = util.getValue(lines, 'partnumber', ':');
|
|
692
692
|
if (!result.assetTag) {
|
|
693
|
-
result.assetTag = util.getValue(lines, 'sku', '
|
|
693
|
+
result.assetTag = util.getValue(lines, 'sku', ':');
|
|
694
694
|
}
|
|
695
695
|
|
|
696
696
|
// memphysical
|
|
697
697
|
lines = data.results[1] ? data.results[1].toString().split('\r\n') : [''];
|
|
698
|
-
result.memMax = util.toInt(util.getValue(lines, 'MaxCapacity', '
|
|
699
|
-
result.memSlots = util.toInt(util.getValue(lines, 'MemoryDevices', '
|
|
698
|
+
result.memMax = util.toInt(util.getValue(lines, 'MaxCapacity', ':')) || null;
|
|
699
|
+
result.memSlots = util.toInt(util.getValue(lines, 'MemoryDevices', ':')) || null;
|
|
700
700
|
|
|
701
701
|
if (callback) { callback(result); }
|
|
702
702
|
resolve(result);
|
|
@@ -807,18 +807,18 @@ function chassis(callback) {
|
|
|
807
807
|
}
|
|
808
808
|
if (_windows) {
|
|
809
809
|
try {
|
|
810
|
-
util.
|
|
810
|
+
util.powerShell('Get-WmiObject Win32_SystemEnclosure | fl *').then((stdout, error) => {
|
|
811
811
|
if (!error) {
|
|
812
812
|
let lines = stdout.toString().split('\r\n');
|
|
813
813
|
|
|
814
|
-
result.manufacturer = util.getValue(lines, 'manufacturer', '
|
|
815
|
-
result.model = util.getValue(lines, 'model', '
|
|
816
|
-
const ctype = parseInt(util.getValue(lines, 'ChassisTypes', '
|
|
814
|
+
result.manufacturer = util.getValue(lines, 'manufacturer', ':');
|
|
815
|
+
result.model = util.getValue(lines, 'model', ':');
|
|
816
|
+
const ctype = parseInt(util.getValue(lines, 'ChassisTypes', ':').replace(/\D/g, ''));
|
|
817
817
|
result.type = (ctype && !isNaN(ctype) && ctype < chassisTypes.length) ? chassisTypes[ctype - 1] : '';
|
|
818
|
-
result.version = util.getValue(lines, 'version', '
|
|
819
|
-
result.serial = util.getValue(lines, 'serialnumber', '
|
|
820
|
-
result.assetTag = util.getValue(lines, 'partnumber', '
|
|
821
|
-
result.sku = util.getValue(lines, 'sku', '
|
|
818
|
+
result.version = util.getValue(lines, 'version', ':');
|
|
819
|
+
result.serial = util.getValue(lines, 'serialnumber', ':');
|
|
820
|
+
result.assetTag = util.getValue(lines, 'partnumber', ':');
|
|
821
|
+
result.sku = util.getValue(lines, 'sku', ':');
|
|
822
822
|
if (result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) { result.manufacturer = '-'; }
|
|
823
823
|
if (result.version.toLowerCase().indexOf('o.e.m.') !== -1) { result.version = '-'; }
|
|
824
824
|
if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; }
|