systeminformation 5.9.1 → 5.9.2

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/CHANGELOG.md CHANGED
@@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
77
77
 
78
78
  | Version | Date | Comment |
79
79
  | -------------- | -------------- | -------- |
80
+ | 5.9.2 | 2021-09-16 | `graohics()` (macOS), `memLayout()` (win) improvements |
80
81
  | 5.9.1 | 2021-09-15 | `diskLayout()` fix size (macOS) |
81
82
  | 5.9.0 | 2021-09-15 | `graphics()` new XML parser, added properties (macOS) |
82
83
  | 5.8.9 | 2021-09-13 | `battery()` fix linux |
package/README.md CHANGED
@@ -287,20 +287,29 @@ Full function reference with examples can be found at [https://systeminformation
287
287
  | --------------- | ------------- | ----- | ------- | --- | --- | --- | -------- |
288
288
  | si.graphics(cb) | {...} | X | | X | X | | arrays of graphics controllers and displays |
289
289
  | | controllers[]| X | | X | X | | graphics controllers array |
290
- | | ...[0].model | X | | X | X | | graphics controller model |
291
290
  | | ...[0].vendor | X | | X | X | | e.g. ATI |
292
- | | ...[0].deviceName | | | | X | | e.g. \\\\.\\DISPLAY1 |
291
+ | | ...[0].vendorId | | | X | | | vendor ID |
292
+ | | ...[0].model | X | | X | X | | graphics controller model |
293
+ | | ...[0].deviceId | | | X | | | device ID |
293
294
  | | ...[0].bus | X | | X | X | | on which bus (e.g. PCIe) |
294
295
  | | ...[0].vram | X | | X | X | | VRAM size (in MB) |
295
296
  | | ...[0].vramDynamic | X | | X | X | | true if dynamicly allocated ram |
297
+ | | ...[0].external | | | X | | | is external GPU |
298
+ | | ...[0].cores | | | X | | | Apple silicon only |
299
+ | | ...[0].metalVersion | | | X | | | Apple Metal Version |
296
300
  | | displays[] | X | | X | X | | monitor/display array |
297
301
  | | ...[0].vendor | | | | X | | monitor/display vendor |
302
+ | | ...[0].vendorId | | | X | | | vendor ID |
303
+ | | ...[0].deviceName | | | | X | | e.g. \\\\.\\DISPLAY1 |
298
304
  | | ...[0].model | X | | X | X | | monitor/display model |
305
+ | | ...[0].productionYear | | | X | | | production year |
306
+ | | ...[0].serial | | | X | | | serial number |
307
+ | | ...[0].displayId | | | X | | | display ID |
299
308
  | | ...[0].main | X | | X | X| | true if main monitor |
300
309
  | | ...[0].builtin | X | | X | | | true if built in monitor |
301
310
  | | ...[0].connection | X | | X | X | | e.g. DisplayPort or HDMI |
302
- | | ...[0].sizeX | X | | X | X | | size in mm horizontal |
303
- | | ...[0].sizeY | X | | X | X | | size in mm vertical |
311
+ | | ...[0].sizeX | X | | | X | | size in mm horizontal |
312
+ | | ...[0].sizeY | X | | | X | | size in mm vertical |
304
313
  | | ...[0].pixelDepth | X | | X | X | | color depth in bits |
305
314
  | | ...[0].resolutionX | X | | X | X | | pixel horizontal |
306
315
  | | ...[0].resolutionY | X | | X | X | | pixel vertical |
package/lib/graphics.js CHANGED
@@ -68,17 +68,17 @@ function getVendorFromModel(model) {
68
68
  { pattern: '^ACER.+', manufacturer: 'Acer' },
69
69
  { pattern: '^AOC.+', manufacturer: 'AOC Monitors' },
70
70
  { pattern: '^HP.+', manufacturer: 'HP' },
71
- { pattern: '^EIZO.+', manufacturer: 'Eizo' },
72
- { pattern: '^PHILIPS.+', manufacturer: 'Philips' },
73
- { pattern: '^IIYAMA.+', manufacturer: 'Iiyama' },
74
- { pattern: '^SHARP.+', manufacturer: 'Sharp' },
75
- { pattern: '^NEC.+', manufacturer: 'NEC' },
76
- { pattern: '^LENOVO.+', manufacturer: 'Lenovo' },
77
- { pattern: 'COMPAQ.+', manufacturer: 'Compaq' },
78
- { pattern: 'APPLE.+', manufacturer: 'Apple' },
79
- { pattern: 'INTEL.+', manufacturer: 'Intel' },
80
- { pattern: 'AMD.+', manufacturer: 'AMD' },
81
- { pattern: 'NVIDIA.+', manufacturer: 'NVDIA' },
71
+ { pattern: '^EIZO.?', manufacturer: 'Eizo' },
72
+ { pattern: '^PHILIPS.?', manufacturer: 'Philips' },
73
+ { pattern: '^IIYAMA.?', manufacturer: 'Iiyama' },
74
+ { pattern: '^SHARP.?', manufacturer: 'Sharp' },
75
+ { pattern: '^NEC.?', manufacturer: 'NEC' },
76
+ { pattern: '^LENOVO.?', manufacturer: 'Lenovo' },
77
+ { pattern: 'COMPAQ.?', manufacturer: 'Compaq' },
78
+ { pattern: 'APPLE.?', manufacturer: 'Apple' },
79
+ { pattern: 'INTEL.?', manufacturer: 'Intel' },
80
+ { pattern: 'AMD.?', manufacturer: 'AMD' },
81
+ { pattern: 'NVIDIA.?', manufacturer: 'NVDIA' },
82
82
  ];
83
83
 
84
84
  let result = '';
@@ -125,6 +125,11 @@ function getMetalVersion(id) {
125
125
  'spdisplays_mtlgpufamilyapple5': 'apple5',
126
126
  'spdisplays_mtlgpufamilyapple6': 'apple6',
127
127
  'spdisplays_mtlgpufamilyapple7': 'apple7',
128
+ 'spdisplays_metalfeaturesetfamily11': 'family1_v1',
129
+ 'spdisplays_metalfeaturesetfamily12': 'family1_v2',
130
+ 'spdisplays_metalfeaturesetfamily13': 'family1_v3',
131
+ 'spdisplays_metalfeaturesetfamily14': 'family1_v4',
132
+ 'spdisplays_metalfeaturesetfamily21': 'family2_v1'
128
133
  };
129
134
  return families[id] || '';
130
135
  }
@@ -139,16 +144,16 @@ function graphics(callback) {
139
144
  try {
140
145
  graphicsArr.forEach(function (item) {
141
146
  // controllers
142
- const bus = ((item.sppci_bus || '').indexOf('builtin') ? 'Built-In' : ((item.sppci_bus || '').indexOf('pcie') ? 'PCIE' : ''));
143
- const vram = (parseInt((item._spdisplays_vram || ''), 10) || 0) * (((item._spdisplays_vram || '').indexOf('GB') > -1) ? 1024 : 1);
144
- const vramDyn = (parseInt((item.spdisplays_vram_shares || ''), 10) || 0) * (((item.spdisplays_vram_shares || '').indexOf('GB') > -1) ? 1024 : 1);
147
+ const bus = ((item.sppci_bus || '').indexOf('builtin') > -1 ? 'Built-In' : ((item.sppci_bus || '').indexOf('pcie') > -1 ? 'PCIe' : ''));
148
+ const vram = (parseInt((item.spdisplays_vram || ''), 10) || 0) * (((item.spdisplays_vram || '').indexOf('GB') > -1) ? 1024 : 1);
149
+ const vramDyn = (parseInt((item.spdisplays_vram_shared || ''), 10) || 0) * (((item.spdisplays_vram_shared || '').indexOf('GB') > -1) ? 1024 : 1);
145
150
  let metalVersion = getMetalVersion(item.spdisplays_metal || item.spdisplays_metalfamily || '');
146
151
  res.controllers.push({
147
152
  vendor: getVendorFromModel(item.spdisplays_vendor || '') || item.spdisplays_vendor || '',
148
153
  model: item.sppci_model || '',
149
154
  bus,
150
155
  vramDynamic: bus === 'Built-In',
151
- vram: vram || vramDyn || 0,
156
+ vram: vram || vramDyn || null,
152
157
  deviceId: item['spdisplays_device-id'] || '',
153
158
  vendorId: item['spdisplays_vendor-id'] || vendorToId((item['spdisplays_vendor'] || '') + (item.sppci_model || '')),
154
159
  external: (item.sppci_device_type === 'spdisplays_egpu'),
@@ -159,7 +164,7 @@ function graphics(callback) {
159
164
  // displays
160
165
  if (item.spdisplays_ndrvs && item.spdisplays_ndrvs.length) {
161
166
  item.spdisplays_ndrvs.forEach(function (displayItem) {
162
- const connectionType = displayItem['spdisplays_connection_type'];
167
+ const connectionType = displayItem['spdisplays_connection_type'] || '';
163
168
  const currentResolutionParts = (displayItem['_spdisplays_resolution'] || '').split('@');
164
169
  const currentResolution = currentResolutionParts[0].split('x');
165
170
  const pixelParts = (displayItem['_spdisplays_pixels'] || '').split('x');
@@ -172,9 +177,9 @@ function graphics(callback) {
172
177
  productionYear: displayItem['_spdisplays_display-year'] || null,
173
178
  serial: serial !== '0' ? serial : null,
174
179
  displayId: displayItem['_spdisplays_displayID'] || null,
175
- main: displayItem['spdisplays_main'] ? displayItem['spdisplays_main'] === 'spdisplays_yes' : true,
176
- builtin: (displayItem['spdisplays_display_type'] || '').indexOf('built-in') >= 0,
177
- connection: ((connectionType.indexOf('_internal')) ? 'Internal' : ((connectionType.indexOf('_displayport')) ? 'Display Port' : ((connectionType.indexOf('_hdmi')) ? 'HDMI' : ''))),
180
+ main: displayItem['spdisplays_main'] ? displayItem['spdisplays_main'] === 'spdisplays_yes' : false,
181
+ builtin: (displayItem['spdisplays_display_type'] || '').indexOf('built-in') > -1,
182
+ connection: ((connectionType.indexOf('_internal') > -1) ? 'Internal' : ((connectionType.indexOf('_displayport') > -1) ? 'Display Port' : ((connectionType.indexOf('_hdmi') > -1) ? 'HDMI' : null))),
178
183
  sizeX: null,
179
184
  sizeY: null,
180
185
  pixelDepth: (pixelDepthString === 'CGSThirtyBitColor' ? 30 : (pixelDepthString === 'CGSThirtytwoBitColor' ? 32 : (pixelDepthString === 'CGSTwentyfourBitColor' ? 24 : ''))),
package/lib/index.d.ts CHANGED
@@ -151,16 +151,16 @@ export namespace Systeminformation {
151
151
  info_name: string;
152
152
  type: string;
153
153
  protocol: string;
154
- }
154
+ };
155
155
  model_family?: string,
156
156
  model_name?: string,
157
157
  serial_number?: string,
158
158
  firmware_version?: string,
159
159
  smart_status: {
160
160
  passed: boolean;
161
- }
161
+ };
162
162
  trim?: {
163
- supported: boolean
163
+ supported: boolean;
164
164
  },
165
165
  ata_smart_attributes?: {
166
166
  revision: number;
@@ -181,7 +181,7 @@ export namespace Systeminformation {
181
181
  event_count: boolean;
182
182
  auto_keep: boolean;
183
183
  };
184
- raw: { value: number; string: string }
184
+ raw: { value: number; string: string; };
185
185
  }[];
186
186
  };
187
187
  ata_smart_error_log?: {
@@ -209,10 +209,10 @@ export namespace Systeminformation {
209
209
  error_count_total: number;
210
210
  error_count_outdated: number;
211
211
  };
212
- }
212
+ };
213
213
  nvme_pci_vendor?: {
214
214
  id: number,
215
- subsystem_id: number
215
+ subsystem_id: number;
216
216
  },
217
217
  nvme_smart_health_information_log?: {
218
218
  critical_warning?: number,
@@ -232,11 +232,11 @@ export namespace Systeminformation {
232
232
  num_err_log_entries?: number,
233
233
  warning_temp_time?: number,
234
234
  critical_comp_time?: number,
235
- temperature_sensors?: number[]
235
+ temperature_sensors?: number[];
236
236
  },
237
237
  user_capacity?: {
238
238
  blocks: number,
239
- bytes: number
239
+ bytes: number;
240
240
  },
241
241
  logical_block_size?: number,
242
242
  temperature: {
@@ -294,11 +294,16 @@ export namespace Systeminformation {
294
294
 
295
295
  interface GraphicsControllerData {
296
296
  vendor: string;
297
+ vendorId?: string;
297
298
  model: string;
299
+ deviceId?: string;
298
300
  bus: string;
299
301
  busAddress?: string;
300
302
  vram: number;
301
303
  vramDynamic: boolean;
304
+ external?: boolean;
305
+ cores?: number;
306
+ metalVersion?: string;
302
307
  subDeviceId?: string;
303
308
  driverVersion?: string;
304
309
  name?: string;
package/lib/memory.js CHANGED
@@ -508,7 +508,7 @@ function memLayout(callback) {
508
508
  result.push({
509
509
  size: parseInt(util.getValue(lines, 'Capacity', '='), 10) || 0,
510
510
  bank: util.getValue(lines, 'abel', '='), // BankLabel
511
- type: memoryTypes[parseInt(util.getValue(lines, 'MemoryType', '='), 10)],
511
+ type: memoryTypes[parseInt(util.getValue(lines, 'MemoryType', '='), 10) || parseInt(util.getValue(lines, 'SMBIOSMemoryType', '='), 10)],
512
512
  ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
513
513
  clockSpeed: parseInt(util.getValue(lines, 'ConfiguredClockSpeed', '='), 10) || parseInt(util.getValue(lines, 'Speed', '='), 10) || 0,
514
514
  formFactor: FormFactors[parseInt(util.getValue(lines, 'FormFactor', '='), 10) || 0],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.9.1",
3
+ "version": "5.9.2",
4
4
  "description": "Simple system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",