systeminformation 5.9.9 → 5.9.13
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 +1 -0
- package/lib/battery.js +1 -1
- package/lib/cpu.js +20 -10
- package/lib/filesystem.js +53 -49
- package/lib/graphics.js +2 -2
- package/lib/index.d.ts +29 -17
- package/lib/memory.js +2 -2
- package/lib/network.js +1674 -1589
- package/lib/osinfo.js +1148 -1151
- package/lib/system.js +841 -839
- package/lib/users.js +36 -29
- package/lib/util.js +2 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -682
package/README.md
CHANGED
|
@@ -163,6 +163,7 @@ Full function reference with examples can be found at [https://systeminformation
|
|
|
163
163
|
| | version | X | X | X | X | | version |
|
|
164
164
|
| | releaseDate | X | X | | X | | release date |
|
|
165
165
|
| | revision | X | X | | X | | revision |
|
|
166
|
+
| | serial | X | | | X | | serial |
|
|
166
167
|
| si.baseboard(cb) | {...} | X | X | X | X | | baseboard information |
|
|
167
168
|
| | manufacturer | X | X | X | X | | e.g. 'ASUS' |
|
|
168
169
|
| | model | X | X | X | X | | model / product name |
|
package/lib/battery.js
CHANGED
|
@@ -160,7 +160,7 @@ module.exports = function (callback) {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
if (_freebsd || _openbsd || _netbsd) {
|
|
163
|
-
exec('sysctl hw.acpi.battery hw.acpi.acline', function (error, stdout) {
|
|
163
|
+
exec('sysctl -i hw.acpi.battery hw.acpi.acline', function (error, stdout) {
|
|
164
164
|
let lines = stdout.toString().split('\n');
|
|
165
165
|
const batteries = parseInt('0' + util.getValue(lines, 'hw.acpi.battery.units'), 10);
|
|
166
166
|
const percent = parseInt('0' + util.getValue(lines, 'hw.acpi.battery.life'), 10);
|
package/lib/cpu.js
CHANGED
|
@@ -781,7 +781,7 @@ function getCpu() {
|
|
|
781
781
|
try {
|
|
782
782
|
const workload = [];
|
|
783
783
|
workload.push(util.powerShell('Get-WmiObject Win32_processor | fl *'));
|
|
784
|
-
workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,
|
|
784
|
+
workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl *'));
|
|
785
785
|
// workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
|
|
786
786
|
workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
|
|
787
787
|
|
|
@@ -852,16 +852,21 @@ function getCpu() {
|
|
|
852
852
|
parts.forEach(function (part) {
|
|
853
853
|
lines = part.split('\r\n');
|
|
854
854
|
const cacheType = util.getValue(lines, 'CacheType');
|
|
855
|
-
const
|
|
855
|
+
const level = util.getValue(lines, 'Level');
|
|
856
856
|
const installedSize = util.getValue(lines, 'InstalledSize');
|
|
857
857
|
// L1 Instructions
|
|
858
|
-
if (
|
|
858
|
+
if (level === '3' && cacheType === '3') {
|
|
859
859
|
result.cache.l1i = parseInt(installedSize, 10);
|
|
860
860
|
}
|
|
861
861
|
// L1 Data
|
|
862
|
-
if (
|
|
862
|
+
if (level === '3' && cacheType === '4') {
|
|
863
863
|
result.cache.l1d = parseInt(installedSize, 10);
|
|
864
864
|
}
|
|
865
|
+
// L1 all
|
|
866
|
+
if (level === '3' && cacheType === '5' && !result.cache.l1i && !result.cache.l1d) {
|
|
867
|
+
result.cache.l1i = parseInt(installedSize, 10) / 2;
|
|
868
|
+
result.cache.l1d = parseInt(installedSize, 10) / 2;
|
|
869
|
+
}
|
|
865
870
|
});
|
|
866
871
|
// lines = data[2].split('\r\n');
|
|
867
872
|
// result.virtualization = (util.getValue(lines, 'HyperVRequirementVirtualizationFirmwareEnabled').toLowerCase() === 'true');
|
|
@@ -1413,21 +1418,26 @@ function cpuCache(callback) {
|
|
|
1413
1418
|
if (result.l2) { result.l2 = parseInt(result.l2, 10) * 1024; }
|
|
1414
1419
|
if (result.l3) { result.l3 = parseInt(result.l3, 10) * 1024; }
|
|
1415
1420
|
}
|
|
1416
|
-
util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,
|
|
1421
|
+
util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl ').then((stdout, error) => {
|
|
1417
1422
|
if (!error) {
|
|
1418
1423
|
const parts = stdout.split(/\n\s*\n/);
|
|
1419
1424
|
parts.forEach(function (part) {
|
|
1420
1425
|
const lines = part.split('\r\n');
|
|
1421
1426
|
const cacheType = util.getValue(lines, 'CacheType');
|
|
1422
|
-
const
|
|
1427
|
+
const level = util.getValue(lines, 'Level');
|
|
1423
1428
|
const installedSize = util.getValue(lines, 'InstalledSize');
|
|
1424
1429
|
// L1 Instructions
|
|
1425
|
-
if (
|
|
1426
|
-
result.l1i = parseInt(installedSize, 10);
|
|
1430
|
+
if (level === '3' && cacheType === '3') {
|
|
1431
|
+
result.cache.l1i = parseInt(installedSize, 10);
|
|
1427
1432
|
}
|
|
1428
1433
|
// L1 Data
|
|
1429
|
-
if (
|
|
1430
|
-
result.l1d = parseInt(installedSize, 10);
|
|
1434
|
+
if (level === '3' && cacheType === '4') {
|
|
1435
|
+
result.cache.l1d = parseInt(installedSize, 10);
|
|
1436
|
+
}
|
|
1437
|
+
// L1 all
|
|
1438
|
+
if (level === '3' && cacheType === '5' && !result.cache.l1i && !result.cache.l1d) {
|
|
1439
|
+
result.cache.l1i = parseInt(installedSize, 10) / 2;
|
|
1440
|
+
result.cache.l1d = parseInt(installedSize, 10) / 2;
|
|
1431
1441
|
}
|
|
1432
1442
|
});
|
|
1433
1443
|
}
|
package/lib/filesystem.js
CHANGED
|
@@ -126,24 +126,28 @@ function fsSize(callback) {
|
|
|
126
126
|
}
|
|
127
127
|
if (_windows) {
|
|
128
128
|
try {
|
|
129
|
-
util.wmic('logicaldisk get Caption,FileSystem,FreeSpace,Size').then((stdout) => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
// util.wmic('logicaldisk get Caption,FileSystem,FreeSpace,Size').then((stdout) => {
|
|
130
|
+
util.powerShell('Get-WmiObject Win32_logicaldisk | fl *').then((stdout, error) => {
|
|
131
|
+
if (!error) {
|
|
132
|
+
let devices = stdout.toString().split(/\n\s*\n/);
|
|
133
|
+
devices.forEach(function (device) {
|
|
134
|
+
let lines = device.split('\r\n');
|
|
135
|
+
const size = util.toInt(util.getValue(lines, 'size', ':'));
|
|
136
|
+
const free = util.toInt(util.getValue(lines, 'freespace', ':'));
|
|
137
|
+
const caption = util.getValue(lines, 'caption', ':');
|
|
138
|
+
if (size) {
|
|
135
139
|
data.push({
|
|
136
|
-
fs:
|
|
137
|
-
type:
|
|
138
|
-
size
|
|
139
|
-
used:
|
|
140
|
-
available:
|
|
141
|
-
use: parseFloat(((100.0 * (
|
|
142
|
-
mount:
|
|
140
|
+
fs: caption,
|
|
141
|
+
type: util.getValue(lines, 'filesystem', ':'),
|
|
142
|
+
size,
|
|
143
|
+
used: size - free,
|
|
144
|
+
available: free,
|
|
145
|
+
use: parseFloat(((100.0 * (size - free)) / size).toFixed(2)),
|
|
146
|
+
mount: caption
|
|
143
147
|
});
|
|
144
148
|
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
147
151
|
if (callback) {
|
|
148
152
|
callback(data);
|
|
149
153
|
}
|
|
@@ -173,12 +177,12 @@ function fsOpenFiles(callback) {
|
|
|
173
177
|
available: null
|
|
174
178
|
};
|
|
175
179
|
if (_freebsd || _openbsd || _netbsd || _darwin) {
|
|
176
|
-
let cmd = 'sysctl -
|
|
180
|
+
let cmd = 'sysctl -i kern.maxfiles kern.num_files kern.open_files';
|
|
177
181
|
exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
|
178
182
|
if (!error) {
|
|
179
183
|
let lines = stdout.toString().split('\n');
|
|
180
184
|
result.max = parseInt(util.getValue(lines, 'kern.maxfiles', ':'), 10);
|
|
181
|
-
result.allocated = parseInt(util.getValue(lines, 'kern.num_files', ':'), 10);
|
|
185
|
+
result.allocated = parseInt(util.getValue(lines, 'kern.num_files', ':'), 10) || parseInt(util.getValue(lines, 'kern.open_files', ':'), 10);
|
|
182
186
|
result.available = result.max - result.allocated;
|
|
183
187
|
}
|
|
184
188
|
if (callback) {
|
|
@@ -493,7 +497,7 @@ function fsStats(callback) {
|
|
|
493
497
|
|
|
494
498
|
return new Promise((resolve) => {
|
|
495
499
|
process.nextTick(() => {
|
|
496
|
-
if (_windows) {
|
|
500
|
+
if (_windows || _freebsd || _openbsd || _netbsd || _sunos) {
|
|
497
501
|
return resolve(null);
|
|
498
502
|
}
|
|
499
503
|
|
|
@@ -776,37 +780,37 @@ function diskLayout(callback) {
|
|
|
776
780
|
|
|
777
781
|
function getVendorFromModel(model) {
|
|
778
782
|
const diskManufacturers = [
|
|
779
|
-
{ pattern: '
|
|
780
|
-
{ pattern: '^WDC
|
|
781
|
-
{ pattern: 'WD
|
|
782
|
-
{ pattern: '
|
|
783
|
-
{ pattern: '
|
|
784
|
-
{ pattern: '^IC
|
|
785
|
-
{ pattern: '^HTS
|
|
786
|
-
{ pattern: '
|
|
787
|
-
{ pattern: '
|
|
788
|
-
{ pattern: '^SONY
|
|
789
|
-
{ pattern: '
|
|
790
|
-
{ pattern: 'SAMSUNG
|
|
791
|
-
{ pattern: '^ST(?!I\\ )
|
|
792
|
-
{ pattern: '^STI\\
|
|
793
|
-
{ pattern: '^D
|
|
794
|
-
{ pattern: '^IBM
|
|
795
|
-
{ pattern: '^FUJITSU
|
|
796
|
-
{ pattern: '^MP
|
|
797
|
-
{ pattern: '^MK
|
|
798
|
-
{ pattern: '
|
|
799
|
-
{ pattern: '
|
|
800
|
-
{ pattern: '
|
|
801
|
-
{ pattern: '
|
|
802
|
-
{ pattern: 'FIREBALL
|
|
803
|
-
{ pattern: '^VBOX
|
|
804
|
-
{ pattern: 'CORSAIR
|
|
805
|
-
{ pattern: 'CRUCIAL
|
|
806
|
-
{ pattern: 'ECM
|
|
807
|
-
{ pattern: 'INTEL
|
|
808
|
-
{ pattern: '
|
|
809
|
-
{ pattern: 'APPLE
|
|
783
|
+
{ pattern: 'WESTERN.*', manufacturer: 'Western Digital' },
|
|
784
|
+
{ pattern: '^WDC.*', manufacturer: 'Western Digital' },
|
|
785
|
+
{ pattern: 'WD.*', manufacturer: 'Western Digital' },
|
|
786
|
+
{ pattern: 'TOSHIBA.*', manufacturer: 'Toshiba' },
|
|
787
|
+
{ pattern: 'HITACHI.*', manufacturer: 'Hitachi' },
|
|
788
|
+
{ pattern: '^IC.*', manufacturer: 'Hitachi' },
|
|
789
|
+
{ pattern: '^HTS.*', manufacturer: 'Hitachi' },
|
|
790
|
+
{ pattern: 'SANDISK.*', manufacturer: 'SanDisk' },
|
|
791
|
+
{ pattern: 'KINGSTON.*', manufacturer: 'Kingston Technology' },
|
|
792
|
+
{ pattern: '^SONY.*', manufacturer: 'Sony' },
|
|
793
|
+
{ pattern: 'TRANSCEND.*', manufacturer: 'Transcend' },
|
|
794
|
+
{ pattern: 'SAMSUNG.*', manufacturer: 'Samsung' },
|
|
795
|
+
{ pattern: '^ST(?!I\\ ).*', manufacturer: 'Seagate' },
|
|
796
|
+
{ pattern: '^STI\\ .*', manufacturer: 'SimpleTech' },
|
|
797
|
+
{ pattern: '^D...-.*', manufacturer: 'IBM' },
|
|
798
|
+
{ pattern: '^IBM.*', manufacturer: 'IBM' },
|
|
799
|
+
{ pattern: '^FUJITSU.*', manufacturer: 'Fujitsu' },
|
|
800
|
+
{ pattern: '^MP.*', manufacturer: 'Fujitsu' },
|
|
801
|
+
{ pattern: '^MK.*', manufacturer: 'Toshiba' },
|
|
802
|
+
{ pattern: 'MAXTO.*', manufacturer: 'Maxtor' },
|
|
803
|
+
{ pattern: 'PIONEER.*', manufacturer: 'Pioneer' },
|
|
804
|
+
{ pattern: 'PHILIPS.*', manufacturer: 'Philips' },
|
|
805
|
+
{ pattern: 'QUANTUM.*', manufacturer: 'Quantum Technology' },
|
|
806
|
+
{ pattern: 'FIREBALL.*', manufacturer: 'Quantum Technology' },
|
|
807
|
+
{ pattern: '^VBOX.*', manufacturer: 'VirtualBox' },
|
|
808
|
+
{ pattern: 'CORSAIR.*', manufacturer: 'Corsair Components' },
|
|
809
|
+
{ pattern: 'CRUCIAL.*', manufacturer: 'Crucial' },
|
|
810
|
+
{ pattern: 'ECM.*', manufacturer: 'ECM' },
|
|
811
|
+
{ pattern: 'INTEL.*', manufacturer: 'INTEL' },
|
|
812
|
+
{ pattern: 'EVO.*', manufacturer: 'Samsung' },
|
|
813
|
+
{ pattern: 'APPLE.*', manufacturer: 'Apple' },
|
|
810
814
|
];
|
|
811
815
|
|
|
812
816
|
let result = '';
|
package/lib/graphics.js
CHANGED
|
@@ -181,7 +181,7 @@ function graphics(callback) {
|
|
|
181
181
|
connection: ((connectionType.indexOf('_internal') > -1) ? 'Internal' : ((connectionType.indexOf('_displayport') > -1) ? 'Display Port' : ((connectionType.indexOf('_hdmi') > -1) ? 'HDMI' : null))),
|
|
182
182
|
sizeX: null,
|
|
183
183
|
sizeY: null,
|
|
184
|
-
pixelDepth: (pixelDepthString === 'CGSThirtyBitColor' ? 30 : (pixelDepthString === 'CGSThirtytwoBitColor' ? 32 : (pixelDepthString === 'CGSTwentyfourBitColor' ? 24 :
|
|
184
|
+
pixelDepth: (pixelDepthString === 'CGSThirtyBitColor' ? 30 : (pixelDepthString === 'CGSThirtytwoBitColor' ? 32 : (pixelDepthString === 'CGSTwentyfourBitColor' ? 24 : null))),
|
|
185
185
|
resolutionX: pixelParts.length > 1 ? parseInt(pixelParts[0], 10) : null,
|
|
186
186
|
resolutionY: pixelParts.length > 1 ? parseInt(pixelParts[1], 10) : null,
|
|
187
187
|
currentResX: currentResolution.length > 1 ? parseInt(currentResolution[0], 10) : null,
|
|
@@ -860,7 +860,7 @@ function graphics(callback) {
|
|
|
860
860
|
if (_pixelDepth) {
|
|
861
861
|
result.displays[0].pixelDepth = _pixelDepth;
|
|
862
862
|
}
|
|
863
|
-
if (_refreshRate && !result.displays[0].
|
|
863
|
+
if (_refreshRate && !result.displays[0].currentRefreshRate) {
|
|
864
864
|
result.displays[0].currentRefreshRate = _refreshRate;
|
|
865
865
|
}
|
|
866
866
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export namespace Systeminformation {
|
|
|
38
38
|
version: string;
|
|
39
39
|
releaseDate: string;
|
|
40
40
|
revision: string;
|
|
41
|
+
serial?: string;
|
|
41
42
|
language?: string;
|
|
42
43
|
features?: string[];
|
|
43
44
|
}
|
|
@@ -302,7 +303,7 @@ export namespace Systeminformation {
|
|
|
302
303
|
deviceId?: string;
|
|
303
304
|
bus: string;
|
|
304
305
|
busAddress?: string;
|
|
305
|
-
vram: number;
|
|
306
|
+
vram: number | null;
|
|
306
307
|
vramDynamic: boolean;
|
|
307
308
|
external?: boolean;
|
|
308
309
|
cores?: number;
|
|
@@ -311,6 +312,7 @@ export namespace Systeminformation {
|
|
|
311
312
|
driverVersion?: string;
|
|
312
313
|
name?: string;
|
|
313
314
|
pciBus?: string;
|
|
315
|
+
pciID?: string;
|
|
314
316
|
fanSpeed?: number;
|
|
315
317
|
memoryTotal?: number;
|
|
316
318
|
memoryUsed?: number;
|
|
@@ -327,21 +329,25 @@ export namespace Systeminformation {
|
|
|
327
329
|
|
|
328
330
|
interface GraphicsDisplayData {
|
|
329
331
|
vendor: string;
|
|
332
|
+
vendorId: string | null;
|
|
330
333
|
model: string;
|
|
331
|
-
|
|
334
|
+
productionYear: number | null;
|
|
335
|
+
serial: string | null;
|
|
336
|
+
deviceName: string | null;
|
|
337
|
+
displayId: string | null;
|
|
332
338
|
main: boolean;
|
|
333
339
|
builtin: boolean;
|
|
334
|
-
connection: string;
|
|
335
|
-
sizeX: number;
|
|
336
|
-
sizeY: number;
|
|
337
|
-
pixelDepth: number;
|
|
338
|
-
resolutionX: number;
|
|
339
|
-
resolutionY: number;
|
|
340
|
-
currentResX: number;
|
|
341
|
-
currentResY: number;
|
|
340
|
+
connection: string | null;
|
|
341
|
+
sizeX: number | null;
|
|
342
|
+
sizeY: number | null;
|
|
343
|
+
pixelDepth: number | null;
|
|
344
|
+
resolutionX: number | null;
|
|
345
|
+
resolutionY: number | null;
|
|
346
|
+
currentResX: number | null;
|
|
347
|
+
currentResY: number | null;
|
|
342
348
|
positionX: number;
|
|
343
349
|
positionY: number;
|
|
344
|
-
currentRefreshRate: number;
|
|
350
|
+
currentRefreshRate: number | null;
|
|
345
351
|
}
|
|
346
352
|
|
|
347
353
|
// 4. Operating System
|
|
@@ -452,9 +458,9 @@ export namespace Systeminformation {
|
|
|
452
458
|
rx: number;
|
|
453
459
|
wx: number;
|
|
454
460
|
tx: number;
|
|
455
|
-
rx_sec: number;
|
|
456
|
-
wx_sec: number;
|
|
457
|
-
tx_sec: number;
|
|
461
|
+
rx_sec: number | null;
|
|
462
|
+
wx_sec: number | null;
|
|
463
|
+
tx_sec: number | null;
|
|
458
464
|
ms: number;
|
|
459
465
|
}
|
|
460
466
|
|
|
@@ -462,9 +468,15 @@ export namespace Systeminformation {
|
|
|
462
468
|
rIO: number;
|
|
463
469
|
wIO: number;
|
|
464
470
|
tIO: number;
|
|
465
|
-
rIO_sec: number;
|
|
466
|
-
wIO_sec: number;
|
|
467
|
-
tIO_sec: number;
|
|
471
|
+
rIO_sec: number | null;
|
|
472
|
+
wIO_sec: number | null;
|
|
473
|
+
tIO_sec: number | null;
|
|
474
|
+
rWaitTime: number;
|
|
475
|
+
wWaitTime: number;
|
|
476
|
+
tWaitTime: number;
|
|
477
|
+
rWaitPercent: number | null;
|
|
478
|
+
wWaitPercent: number | null;
|
|
479
|
+
tWaitPercent: number | null;
|
|
468
480
|
ms: number;
|
|
469
481
|
}
|
|
470
482
|
|
package/lib/memory.js
CHANGED
|
@@ -198,7 +198,7 @@ function mem(callback) {
|
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
if (_freebsd || _openbsd || _netbsd) {
|
|
201
|
-
exec('/sbin/sysctl
|
|
201
|
+
exec('/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size', function (error, stdout) {
|
|
202
202
|
if (!error) {
|
|
203
203
|
let lines = stdout.toString().split('\n');
|
|
204
204
|
const pagesize = parseInt(util.getValue(lines, 'vm.stats.vm.v_page_size'), 10);
|
|
@@ -331,7 +331,7 @@ function memLayout(callback) {
|
|
|
331
331
|
serialNum: util.getValue(lines, 'Serial Number:'),
|
|
332
332
|
voltageConfigured: parseFloat(util.getValue(lines, 'Configured Voltage:')) || null,
|
|
333
333
|
voltageMin: parseFloat(util.getValue(lines, 'Minimum Voltage:')) || null,
|
|
334
|
-
voltageMax: parseFloat(util.getValue(lines, 'Maximum Voltage:'))|| null,
|
|
334
|
+
voltageMax: parseFloat(util.getValue(lines, 'Maximum Voltage:')) || null,
|
|
335
335
|
});
|
|
336
336
|
} else {
|
|
337
337
|
result.push({
|