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 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,Purpose | fl *'));
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 purpose = util.getValue(lines, 'Purpose');
855
+ const level = util.getValue(lines, 'Level');
856
856
  const installedSize = util.getValue(lines, 'InstalledSize');
857
857
  // L1 Instructions
858
- if (purpose === 'L1 Cache' && cacheType === '3') {
858
+ if (level === '3' && cacheType === '3') {
859
859
  result.cache.l1i = parseInt(installedSize, 10);
860
860
  }
861
861
  // L1 Data
862
- if (purpose === 'L1 Cache' && cacheType === '4') {
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,Purpose | fl ').then((stdout, error) => {
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 purpose = util.getValue(lines, 'Purpose');
1427
+ const level = util.getValue(lines, 'Level');
1423
1428
  const installedSize = util.getValue(lines, 'InstalledSize');
1424
1429
  // L1 Instructions
1425
- if (purpose === 'L1 Cache' && cacheType === '3') {
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 (purpose === 'L1 Cache' && cacheType === '4') {
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
- let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0);
131
- lines.forEach(function (line) {
132
- if (line !== '') {
133
- line = line.trim().split(/\s\s+/);
134
- if (line.length >= 4 && parseInt(line[3], 10)) {
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: line[0],
137
- type: line[1],
138
- size: parseInt(line[3], 10),
139
- used: parseInt(line[3], 10) - parseInt(line[2], 10),
140
- available: parseInt(line[2], 10),
141
- use: parseFloat(((100.0 * (parseInt(line[3]) - parseInt(line[2]))) / parseInt(line[3])).toFixed(2)),
142
- mount: line[0]
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 -a | grep \'kern.*files\'';
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: '^WESTERN.+', manufacturer: 'Western Digital' },
780
- { pattern: '^WDC.+', manufacturer: 'Western Digital' },
781
- { pattern: 'WD.+', manufacturer: 'Western Digital' },
782
- { pattern: '^TOSHIBA.+', manufacturer: 'Toshiba' },
783
- { pattern: '^HITACHI.+', manufacturer: 'Hitachi' },
784
- { pattern: '^IC.+', manufacturer: 'Hitachi' },
785
- { pattern: '^HTS.+', manufacturer: 'Hitachi' },
786
- { pattern: '^SANDISK.+', manufacturer: 'SanDisk' },
787
- { pattern: '^KINGSTON.+', manufacturer: 'Kingston Technology' },
788
- { pattern: '^SONY.+', manufacturer: 'Sony' },
789
- { pattern: '^TRANSCEND.+', manufacturer: 'Transcend' },
790
- { pattern: 'SAMSUNG.+', manufacturer: 'Samsung' },
791
- { pattern: '^ST(?!I\\ ).+', manufacturer: 'Seagate' },
792
- { pattern: '^STI\\ .+', manufacturer: 'SimpleTech' },
793
- { pattern: '^D...-.+', manufacturer: 'IBM' },
794
- { pattern: '^IBM.+', manufacturer: 'IBM' },
795
- { pattern: '^FUJITSU.+', manufacturer: 'Fujitsu' },
796
- { pattern: '^MP.+', manufacturer: 'Fujitsu' },
797
- { pattern: '^MK.+', manufacturer: 'Toshiba' },
798
- { pattern: '^MAXTOR.+', manufacturer: 'Maxtor' },
799
- { pattern: '^Pioneer.+', manufacturer: 'Pioneer' },
800
- { pattern: '^PHILIPS.+', manufacturer: 'Philips' },
801
- { pattern: '^QUANTUM.+', manufacturer: 'Quantum Technology' },
802
- { pattern: 'FIREBALL.+', manufacturer: 'Quantum Technology' },
803
- { pattern: '^VBOX.+', manufacturer: 'VirtualBox' },
804
- { pattern: 'CORSAIR.+', manufacturer: 'Corsair Components' },
805
- { pattern: 'CRUCIAL.+', manufacturer: 'Crucial' },
806
- { pattern: 'ECM.+', manufacturer: 'ECM' },
807
- { pattern: 'INTEL.+', manufacturer: 'INTEL' },
808
- { pattern: '.+EVO', manufacturer: 'Samsung' },
809
- { pattern: 'APPLE.+', manufacturer: '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].refreshRate) {
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
- deviceName: string;
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 -a 2>/dev/null | grep -E "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) {
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({