systeminformation 5.19.1 → 5.21.0

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
@@ -128,6 +128,7 @@ si.cpu()
128
128
 
129
129
  (last 7 major and minor version releases)
130
130
 
131
+ - Version 5.20.0: `mem()` added writeback and dirty (linux)
131
132
  - Version 5.19.0: `currentLoad()` added steal and guest time (linux)
132
133
  - Version 5.18.0: `fsSize()` added optional drive parameter
133
134
  - Version 5.17.0: `graphics()` added positionX, positionY (macOS)
@@ -283,6 +284,8 @@ Full function reference with examples can be found at [https://systeminformation
283
284
  | | swaptotal | X | X | X | X | X | |
284
285
  | | swapused | X | X | X | X | X | |
285
286
  | | swapfree | X | X | X | X | X | |
287
+ | | writeback | X | | | | | |
288
+ | | dirty | X | | | | | |
286
289
  | si.memLayout(cb) | [{...}] | X | X | X | X | | Memory Layout (array) |
287
290
  | | [0].size | X | X | X | X | | size in bytes |
288
291
  | | [0].bank | X | X | | X | | memory bank |
@@ -325,7 +328,8 @@ Full function reference with examples can be found at [https://systeminformation
325
328
  | --------------- | ------------------------- | ----- | --- | --- | --- | --- | ------------------------------------------- |
326
329
  | si.graphics(cb) | {...} | X | | X | X | | arrays of graphics controllers and displays |
327
330
  | | controllers[] | X | | X | X | | graphics controllers array |
328
- | | ...[0].vendor | X | | X | X | | e.g. ATI |
331
+ | | ...[0].vendor | X | | X | X | | e.g. NVIDIA |
332
+ | | ...[0].subvendor | X | | | | | e.g. Gigabyte |
329
333
  | | ...[0].vendorId | | | X | | | vendor ID |
330
334
  | | ...[0].model | X | | X | X | | graphics controller model |
331
335
  | | ...[0].deviceId | | | X | | | device ID |
package/lib/graphics.js CHANGED
@@ -204,6 +204,7 @@ function graphics(callback) {
204
204
  let controllers = [];
205
205
  let currentController = {
206
206
  vendor: '',
207
+ subvendor: '',
207
208
  model: '',
208
209
  bus: '',
209
210
  busAddress: '',
@@ -225,7 +226,15 @@ function graphics(callback) {
225
226
  } catch (e) {
226
227
  util.noop();
227
228
  }
229
+ let i = 1;
228
230
  lines.forEach((line) => {
231
+ let subsystem = '';
232
+ if (i < lines.length && lines[i]) { // get next line;
233
+ subsystem = lines[i];
234
+ if (subsystem.indexOf(':') > 0) {
235
+ subsystem = subsystem.split(':')[1];
236
+ }
237
+ }
229
238
  if ('' !== line.trim()) {
230
239
  if (' ' !== line[0] && '\t' !== line[0]) { // first line of new entry
231
240
  let isExternal = (pciIDs.indexOf(line.split(' ')[0]) >= 0);
@@ -259,7 +268,7 @@ function graphics(callback) {
259
268
  parts[1] = parts[1].trim();
260
269
  if (parts[1].toLowerCase().indexOf('corporation') >= 0) {
261
270
  currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf('corporation') + 11).trim();
262
- currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf('corporation') + 11, 200).trim().split('(')[0];
271
+ currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf('corporation') + 11, 200).split('(')[0].trim();
263
272
  currentController.bus = (pciIDs.length > 0 && isExternal) ? 'PCIe' : 'Onboard';
264
273
  currentController.vram = null;
265
274
  currentController.vramDynamic = false;
@@ -283,6 +292,12 @@ function graphics(callback) {
283
292
  currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(' ltd.') + 5, 200).trim().split('(')[0].trim();
284
293
  }
285
294
  }
295
+ if (currentController.model && subsystem.indexOf(currentController.model) !== -1) {
296
+ const subvendor = subsystem.split(currentController.model)[0].trim();
297
+ if (subvendor) {
298
+ currentController.subvendor = subvendor;
299
+ }
300
+ }
286
301
  }
287
302
 
288
303
  } else {
@@ -300,6 +315,7 @@ function graphics(callback) {
300
315
  }
301
316
  }
302
317
  }
318
+ i++;
303
319
  });
304
320
 
305
321
  if (currentController.vendor || currentController.model || currentController.bus || currentController.busAddress || currentController.vram !== null || currentController.vramDynamic) { // already a controller found
package/lib/index.d.ts CHANGED
@@ -126,6 +126,8 @@ export namespace Systeminformation {
126
126
  swaptotal: number;
127
127
  swapused: number;
128
128
  swapfree: number;
129
+ writeback: number | null;
130
+ dirty: number | null;
129
131
  }
130
132
 
131
133
  interface MemLayoutData {
@@ -304,6 +306,7 @@ export namespace Systeminformation {
304
306
 
305
307
  interface GraphicsControllerData {
306
308
  vendor: string;
309
+ subvendor?: string;
307
310
  vendorId?: string;
308
311
  model: string;
309
312
  deviceId?: string;
package/lib/memory.js CHANGED
@@ -162,7 +162,9 @@ function mem(callback) {
162
162
 
163
163
  swaptotal: 0,
164
164
  swapused: 0,
165
- swapfree: 0
165
+ swapfree: 0,
166
+ writeback: null,
167
+ dirty: null
166
168
  };
167
169
 
168
170
  if (_linux) {
@@ -193,6 +195,10 @@ function mem(callback) {
193
195
  result.swapfree = parseInt(util.getValue(lines, 'swapfree'), 10);
194
196
  result.swapfree = result.swapfree ? result.swapfree * 1024 : 0;
195
197
  result.swapused = result.swaptotal - result.swapfree;
198
+ result.writeback = parseInt(util.getValue(lines, 'writeback'), 10);
199
+ result.writeback = result.writeback ? result.writeback * 1024 : 0;
200
+ result.dirty = parseInt(util.getValue(lines, 'dirty'), 10);
201
+ result.dirty = result.dirty ? result.dirty * 1024 : 0;
196
202
  }
197
203
  if (callback) { callback(result); }
198
204
  resolve(result);
@@ -519,7 +525,8 @@ function memLayout(callback) {
519
525
  resolve(result);
520
526
  }
521
527
  if (_windows) {
522
- const memoryTypes = 'Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4'.split('|');
528
+ // https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0a.pdf
529
+ const memoryTypes = 'Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5'.split('|');
523
530
  const FormFactors = 'Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA'.split('|');
524
531
 
525
532
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.19.1",
3
+ "version": "5.21.0",
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)",