systeminformation 5.16.0 → 5.16.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/README.md CHANGED
@@ -24,10 +24,8 @@
24
24
  [![Git Issues][issues-img]][issues-url]
25
25
  [![Closed Issues][closed-issues-img]][closed-issues-url]
26
26
  <img src="docs/assets/no-dependencies.svg" alt="no dependencies">
27
- [![Code Quality: Javascript][lgtm-badge]][lgtm-badge-url]
28
- [![Total alerts][lgtm-alerts]][lgtm-alerts-url]
29
- [![Caretaker][caretaker-image]][caretaker-url]
30
27
  [![Sponsoring][sponsor-badge]][sponsor-url]
28
+ [![Caretaker][caretaker-image]][caretaker-url]
31
29
  [![MIT license][license-img]][license-url]
32
30
 
33
31
  This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 500 versions published, up to 5 mio downloads per month, > 100 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
@@ -1059,12 +1057,7 @@ All other trademarks are the property of their respective owners.
1059
1057
  [downloads-image]: https://img.shields.io/npm/dm/systeminformation.svg?style=flat-square
1060
1058
  [downloads-url]: https://npmjs.org/package/systeminformation
1061
1059
 
1062
- [lgtm-badge]: https://img.shields.io/lgtm/grade/javascript/g/sebhildebrandt/systeminformation.svg?style=flat-square
1063
- [lgtm-badge-url]: https://lgtm.com/projects/g/sebhildebrandt/systeminformation/context:javascript
1064
- [lgtm-alerts]: https://img.shields.io/lgtm/alerts/g/sebhildebrandt/systeminformation.svg?style=flat-square
1065
- [lgtm-alerts-url]: https://lgtm.com/projects/g/sebhildebrandt/systeminformation/alerts
1066
-
1067
- [sponsor-badge]: https://img.shields.io/badge/-Buy%20me%20a%20coffee-blue?style=flat-square
1060
+ [sponsor-badge]: https://img.shields.io/badge/Support-Buy%20me%20a%20coffee-brightgreen?style=flat-square
1068
1061
  [sponsor-url]: https://www.buymeacoffee.com/systeminfo
1069
1062
 
1070
1063
  [license-url]: https://github.com/sebhildebrandt/systeminformation/blob/master/LICENSE
package/lib/docker.js CHANGED
@@ -361,7 +361,12 @@ function docker_calcCPUPercent(cpu_stats, precpu_stats) {
361
361
 
362
362
  if (systemDelta > 0.0 && cpuDelta > 0.0) {
363
363
  // calculate the change for the cpu usage of the container in between readings
364
- cpuPercent = (cpuDelta / systemDelta) * cpu_stats.cpu_usage.percpu_usage.length * 100.0;
364
+ if (precpu_stats.online_cpus) {
365
+ cpuPercent = (cpuDelta / systemDelta) * precpu_stats.online_cpus * 100.0;
366
+ }
367
+ else {
368
+ cpuPercent = (cpuDelta / systemDelta) * cpu_stats.cpu_usage.percpu_usage.length * 100.0;
369
+ }
365
370
  }
366
371
 
367
372
  return cpuPercent;
@@ -706,6 +711,7 @@ function dockerVolumes(callback) {
706
711
  }
707
712
 
708
713
  exports.dockerVolumes = dockerVolumes;
714
+
709
715
  function dockerAll(callback) {
710
716
  return new Promise((resolve) => {
711
717
  process.nextTick(() => {
package/lib/filesystem.js CHANGED
@@ -132,7 +132,7 @@ function fsSize(callback) {
132
132
  }
133
133
  if (_linux) {
134
134
  cmd = 'df -lkPTx squashfs';
135
- execSync('cat /proc/mounts').toString().split('\n').filter(line => {
135
+ execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => {
136
136
  return line.startsWith('/');
137
137
  }).forEach((line) => {
138
138
  osMounts[line.split(' ')[0]] = line.toLowerCase().indexOf('rw') >= 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.16.0",
3
+ "version": "5.16.2",
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)",