systeminformation 5.17.17 → 5.18.1

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
@@ -111,6 +111,7 @@ si.cpu()
111
111
 
112
112
  (last 7 major and minor version releases)
113
113
 
114
+ - Version 5.18.0: `fsSize()` added optional drive parameter
114
115
  - Version 5.17.0: `graphics()` added positionX, positionY (mac OS)
115
116
  - Version 5.16.0: `fsSize()` added rw property
116
117
  - Version 5.15.0: `blockDevices()` added device
@@ -433,77 +434,77 @@ Full function reference with examples can be found at [https://systeminformation
433
434
 
434
435
  #### 9. File System
435
436
 
436
- | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
437
- | ------------------- | --------------------- | ----- | --- | --- | --- | --- | ------------------------------------------------------------------------ |
438
- | si.diskLayout(cb) | [{...}] | X | | X | X | | physical disk layout (array) |
439
- | | [0].device | X | | X | | | e.g. /dev/sda |
440
- | | [0].type | X | | X | X | | HD, SSD, NVMe |
441
- | | [0].name | X | | X | X | | disk name |
442
- | | [0].vendor | X | | | X | | vendor/producer |
443
- | | [0].size | X | | X | X | | size in bytes |
444
- | | [0].bytesPerSector | | | | X | | bytes per sector |
445
- | | [0].totalCylinders | | | | X | | total cylinders |
446
- | | [0].totalHeads | | | | X | | total heads |
447
- | | [0].totalSectors | | | | X | | total sectors |
448
- | | [0].totalTracks | | | | X | | total tracks |
449
- | | [0].tracksPerCylinder | | | | X | | tracks per cylinder |
450
- | | [0].sectorsPerTrack | | | | X | | sectors per track |
451
- | | [0].firmwareRevision | X | | X | X | | firmware revision |
452
- | | [0].serialNum | X | | X | X | | serial number |
453
- | | [0].interfaceType | X | | | X | | SATA, PCIe, ... |
454
- | | [0].smartStatus | X | | X | X | | S.M.A.R.T Status (see Known Issues) |
455
- | | [0].temperature | X | | | | | S.M.A.R.T temperature |
456
- | | [0].smartData | X | | | X | | full S.M.A.R.T data from smartctl<br>requires at least smartmontools 7.0 |
457
- | si.blockDevices(cb) | [{...}] | X | | X | X | | returns array of disks, partitions,<br>raids and roms |
458
- | | [0].name | X | | X | X | | name |
459
- | | [0].type | X | | X | X | | type |
460
- | | [0].fstype | X | | X | X | | file system type (e.g. ext4) |
461
- | | [0].mount | X | | X | X | | mount point |
462
- | | [0].size | X | | X | X | | size in bytes |
463
- | | [0].physical | X | | X | X | | physical type (HDD, SSD, CD/DVD) |
464
- | | [0].uuid | X | | X | X | | UUID |
465
- | | [0].label | X | | X | X | | label |
466
- | | [0].model | X | | X | | | model |
467
- | | [0].serial | X | | | X | | serial |
468
- | | [0].removable | X | | X | X | | serial |
469
- | | [0].protocol | X | | X | | | protocol (SATA, PCI-Express, ...) |
470
- | | [0].group | X | | | | | Raid group member (e.g. md1) |
471
- | | [0].device | X | | X | X | | physical device mapped to (e.g. /dev/sda) |
472
- | si.disksIO(cb) | {...} | X | | X | | | current transfer stats |
473
- | | rIO | X | | X | | | read IOs on all mounted drives |
474
- | | wIO | X | | X | | | write IOs on all mounted drives |
475
- | | tIO | X | | X | | | write IOs on all mounted drives |
476
- | | rIO_sec | X | | X | | | read IO per sec (* see notes) |
477
- | | wIO_sec | X | | X | | | write IO per sec (* see notes) |
478
- | | tIO_sec | X | | X | | | total IO per sec (* see notes) |
479
- | | rWaitTime | X | | | | | read IO request time (* see notes) |
480
- | | wWaitTime | X | | | | | write IO request time (* see notes) |
481
- | | tWaitTime | X | | | | | total IO request time (* see notes) |
482
- | | rWaitPercent | X | | | | | read IO request time percent (* see notes) |
483
- | | wWaitPercent | X | | | | | write IO request time percent (* see notes) |
484
- | | tWaitPercent | X | | | | | total IO request time percent (* see notes) |
485
- | | ms | X | | X | | | interval length (for per second values) |
486
- | si.fsSize(cb) | [{...}] | X | X | X | X | | returns array of mounted file systems |
487
- | | [0].fs | X | X | X | X | | name of file system |
488
- | | [0].type | X | X | X | X | | type of file system |
489
- | | [0].size | X | X | X | X | | sizes in bytes |
490
- | | [0].used | X | X | X | X | | used in bytes |
491
- | | [0].available | X | X | X | X | | used in bytes |
492
- | | [0].use | X | X | X | X | | used in % |
493
- | | [0].mount | X | X | X | X | | mount point |
494
- | | [0].rw | X | X | X | X | | read and write (false if read only) |
495
- | si.fsOpenFiles(cb) | {...} | X | X | X | | | count max/allocated file descriptors |
496
- | | max | X | X | X | | | max file descriptors |
497
- | | allocated | X | X | X | | | current open files count |
498
- | | available | X | X | X | | | count available |
499
- | si.fsStats(cb) | {...} | X | | X | | | current transfer stats |
500
- | | rx | X | | X | | | bytes read since startup |
501
- | | wx | X | | X | | | bytes written since startup |
502
- | | tx | X | | X | | | total bytes read + written since startup |
503
- | | rx_sec | X | | X | | | bytes read / second (* see notes) |
504
- | | wx_sec | X | | X | | | bytes written / second (* see notes) |
505
- | | tx_sec | X | | X | | | total bytes reads + written / second |
506
- | | ms | X | | X | | | interval length (for per second values) |
437
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
438
+ | -------------------- | --------------------- | ----- | --- | --- | --- | --- | ------------------------------------------------------------------------ |
439
+ | si.diskLayout(cb) | [{...}] | X | | X | X | | physical disk layout (array) |
440
+ | | [0].device | X | | X | | | e.g. /dev/sda |
441
+ | | [0].type | X | | X | X | | HD, SSD, NVMe |
442
+ | | [0].name | X | | X | X | | disk name |
443
+ | | [0].vendor | X | | | X | | vendor/producer |
444
+ | | [0].size | X | | X | X | | size in bytes |
445
+ | | [0].bytesPerSector | | | | X | | bytes per sector |
446
+ | | [0].totalCylinders | | | | X | | total cylinders |
447
+ | | [0].totalHeads | | | | X | | total heads |
448
+ | | [0].totalSectors | | | | X | | total sectors |
449
+ | | [0].totalTracks | | | | X | | total tracks |
450
+ | | [0].tracksPerCylinder | | | | X | | tracks per cylinder |
451
+ | | [0].sectorsPerTrack | | | | X | | sectors per track |
452
+ | | [0].firmwareRevision | X | | X | X | | firmware revision |
453
+ | | [0].serialNum | X | | X | X | | serial number |
454
+ | | [0].interfaceType | X | | | X | | SATA, PCIe, ... |
455
+ | | [0].smartStatus | X | | X | X | | S.M.A.R.T Status (see Known Issues) |
456
+ | | [0].temperature | X | | | | | S.M.A.R.T temperature |
457
+ | | [0].smartData | X | | | X | | full S.M.A.R.T data from smartctl<br>requires at least smartmontools 7.0 |
458
+ | si.blockDevices(cb) | [{...}] | X | | X | X | | returns array of disks, partitions,<br>raids and roms |
459
+ | | [0].name | X | | X | X | | name |
460
+ | | [0].type | X | | X | X | | type |
461
+ | | [0].fstype | X | | X | X | | file system type (e.g. ext4) |
462
+ | | [0].mount | X | | X | X | | mount point |
463
+ | | [0].size | X | | X | X | | size in bytes |
464
+ | | [0].physical | X | | X | X | | physical type (HDD, SSD, CD/DVD) |
465
+ | | [0].uuid | X | | X | X | | UUID |
466
+ | | [0].label | X | | X | X | | label |
467
+ | | [0].model | X | | X | | | model |
468
+ | | [0].serial | X | | | X | | serial |
469
+ | | [0].removable | X | | X | X | | serial |
470
+ | | [0].protocol | X | | X | | | protocol (SATA, PCI-Express, ...) |
471
+ | | [0].group | X | | | | | Raid group member (e.g. md1) |
472
+ | | [0].device | X | | X | X | | physical device mapped to (e.g. /dev/sda) |
473
+ | si.disksIO(cb) | {...} | X | | X | | | current transfer stats |
474
+ | | rIO | X | | X | | | read IOs on all mounted drives |
475
+ | | wIO | X | | X | | | write IOs on all mounted drives |
476
+ | | tIO | X | | X | | | write IOs on all mounted drives |
477
+ | | rIO_sec | X | | X | | | read IO per sec (* see notes) |
478
+ | | wIO_sec | X | | X | | | write IO per sec (* see notes) |
479
+ | | tIO_sec | X | | X | | | total IO per sec (* see notes) |
480
+ | | rWaitTime | X | | | | | read IO request time (* see notes) |
481
+ | | wWaitTime | X | | | | | write IO request time (* see notes) |
482
+ | | tWaitTime | X | | | | | total IO request time (* see notes) |
483
+ | | rWaitPercent | X | | | | | read IO request time percent (* see notes) |
484
+ | | wWaitPercent | X | | | | | write IO request time percent (* see notes) |
485
+ | | tWaitPercent | X | | | | | total IO request time percent (* see notes) |
486
+ | | ms | X | | X | | | interval length (for per second values) |
487
+ | si.fsSize(drive, cb) | [{...}] | X | X | X | X | | returns array of mounted file systems<br>drive param is optional |
488
+ | | [0].fs | X | X | X | X | | name of file system |
489
+ | | [0].type | X | X | X | X | | type of file system |
490
+ | | [0].size | X | X | X | X | | sizes in bytes |
491
+ | | [0].used | X | X | X | X | | used in bytes |
492
+ | | [0].available | X | X | X | X | | used in bytes |
493
+ | | [0].use | X | X | X | X | | used in % |
494
+ | | [0].mount | X | X | X | X | | mount point |
495
+ | | [0].rw | X | X | X | X | | read and write (false if read only) |
496
+ | si.fsOpenFiles(cb) | {...} | X | X | X | | | count max/allocated file descriptors |
497
+ | | max | X | X | X | | | max file descriptors |
498
+ | | allocated | X | X | X | | | current open files count |
499
+ | | available | X | X | X | | | count available |
500
+ | si.fsStats(cb) | {...} | X | | X | | | current transfer stats |
501
+ | | rx | X | | X | | | bytes read since startup |
502
+ | | wx | X | | X | | | bytes written since startup |
503
+ | | tx | X | | X | | | total bytes read + written since startup |
504
+ | | rx_sec | X | | X | | | bytes read / second (* see notes) |
505
+ | | wx_sec | X | | X | | | bytes written / second (* see notes) |
506
+ | | tx_sec | X | | X | | | total bytes reads + written / second |
507
+ | | ms | X | | X | | | interval length (for per second values) |
507
508
 
508
509
  #### 10. USB
509
510
 
package/lib/filesystem.js CHANGED
@@ -36,7 +36,12 @@ let _disk_io = {};
36
36
  // --------------------------
37
37
  // FS - mounted file systems
38
38
 
39
- function fsSize(callback) {
39
+ function fsSize(drive, callback) {
40
+
41
+ if (util.isFunction(drive)) {
42
+ callback = drive;
43
+ drive = '';
44
+ }
40
45
 
41
46
  let macOsDisks = [];
42
47
  let osMounts = [];
@@ -61,6 +66,7 @@ function fsSize(callback) {
61
66
 
62
67
  function filterLines(stdout) {
63
68
  let lines = stdout.toString().split('\n');
69
+ lines.shift();
64
70
  if (stdout.toString().toLowerCase().indexOf('filesystem')) {
65
71
  let removeLines = 0;
66
72
  for (let i = 0; i < lines.length; i++) {
@@ -147,6 +153,11 @@ function fsSize(callback) {
147
153
  exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {
148
154
  let lines = filterLines(stdout);
149
155
  data = parseDf(lines);
156
+ if (drive) {
157
+ data = data.filter(item => {
158
+ return item.fs.toLowerCase().indexOf(drive.toLowerCase()) >= 0 || item.mount.toLowerCase().indexOf(drive.toLowerCase()) >= 0;
159
+ });
160
+ }
150
161
  if (!error || data.length) {
151
162
  if (callback) {
152
163
  callback(data);
@@ -172,8 +183,8 @@ function fsSize(callback) {
172
183
  }
173
184
  if (_windows) {
174
185
  try {
175
- // util.wmic('logicaldisk get Caption,FileSystem,FreeSpace,Size').then((stdout) => {
176
- util.powerShell('Get-CimInstance Win32_logicaldisk | select Access,Caption,FileSystem,FreeSpace,Size | fl').then((stdout, error) => {
186
+ const cmd = `Get-WmiObject Win32_logicaldisk | select Caption,FileSystem,FreeSpace,Size ${drive ? '| where -property Caption -eq ' + drive : ''} | fl`;
187
+ util.powerShell(cmd).then((stdout, error) => {
177
188
  if (!error) {
178
189
  let devices = stdout.toString().split(/\n\s*\n/);
179
190
  devices.forEach(function (device) {
package/lib/index.d.ts CHANGED
@@ -967,7 +967,7 @@ export function memLayout(cb?: (data: Systeminformation.MemLayoutData[]) => any)
967
967
  export function battery(cb?: (data: Systeminformation.BatteryData) => any): Promise<Systeminformation.BatteryData>;
968
968
  export function graphics(cb?: (data: Systeminformation.GraphicsData) => any): Promise<Systeminformation.GraphicsData>;
969
969
 
970
- export function fsSize(cb?: (data: Systeminformation.FsSizeData[]) => any): Promise<Systeminformation.FsSizeData[]>;
970
+ export function fsSize(drive?: string, cb?: (data: Systeminformation.FsSizeData[]) => any): Promise<Systeminformation.FsSizeData[]>;
971
971
  export function fsOpenFiles(cb?: (data: Systeminformation.FsOpenFilesData[]) => any): Promise<Systeminformation.FsOpenFilesData[]>;
972
972
  export function blockDevices(cb?: (data: Systeminformation.BlockDevicesData[]) => any): Promise<Systeminformation.BlockDevicesData[]>;
973
973
  export function fsStats(cb?: (data: Systeminformation.FsStatsData) => any): Promise<Systeminformation.FsStatsData>;
package/lib/network.js CHANGED
@@ -673,9 +673,9 @@ function getLinuxIfaceIEEE8021xState(authenticationProtocol) {
673
673
  }
674
674
 
675
675
  function testVirtualNic(iface, ifaceName, mac) {
676
- const virtualMacs = ['00:00:00:00:00:00', '00:03:FF', '00:05:69', '00:0C:29', '00:0F:4B', '00:0F:4B', '00:13:07', '00:13:BE', '00:15:5d', '00:16:3E', '00:1C:42', '00:21:F6', '00:21:F6', '00:24:0B', '00:24:0B', '00:50:56', '00:A0:B1', '00:E0:C8', '08:00:27', '0A:00:27', '18:92:2C', '16:DF:49', '3C:F3:92', '54:52:00', 'FC:15:97'];
676
+ const virtualMacs = ['00:00:00:00:00:00', '00:03:FF', '00:05:69', '00:0C:29', '00:0F:4B', '00:13:07', '00:13:BE', '00:15:5d', '00:16:3E', '00:1C:42', '00:21:F6', '00:24:0B', '00:50:56', '00:A0:B1', '00:E0:C8', '08:00:27', '0A:00:27', '18:92:2C', '16:DF:49', '3C:F3:92', '54:52:00', 'FC:15:97'];
677
677
  if (mac) {
678
- return virtualMacs.filter(item => { return mac.toUpperCase().toUpperCase().startsWith(item.substr(0, mac.length)); }).length > 0 ||
678
+ return virtualMacs.filter(item => { return mac.toUpperCase().toUpperCase().startsWith(item.substring(0, mac.length)); }).length > 0 ||
679
679
  iface.toLowerCase().indexOf(' virtual ') > -1 ||
680
680
  ifaceName.toLowerCase().indexOf(' virtual ') > -1 ||
681
681
  iface.toLowerCase().indexOf('vethernet ') > -1 ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.17.17",
3
+ "version": "5.18.1",
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)",