systeminformation 5.31.8 → 5.31.10

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/lib/memory.js CHANGED
@@ -258,13 +258,19 @@ function mem(callback) {
258
258
  util.noop();
259
259
  }
260
260
  try {
261
- exec('vm_stat 2>/dev/null | egrep "Pages active|Pages inactive"', (error, stdout) => {
261
+ exec('vm_stat 2>/dev/null | egrep "Pages active|Pages inactive|Pages speculative|Pages wired down|Pages occupied by compressor|Pages purgeable|File-backed pages|Anonymous pages"', (error, stdout) => {
262
262
  if (!error) {
263
263
  let lines = stdout.toString().split('\n');
264
- result.active = (parseInt(util.getValue(lines, 'Pages active'), 10) || 0) * pageSize;
264
+ const wired = (parseInt(util.getValue(lines, 'Pages wired down'), 10) || 0) * pageSize;
265
+ const compressed = (parseInt(util.getValue(lines, 'Pages occupied by compressor'), 10) || 0) * pageSize;
266
+ const purgeable = (parseInt(util.getValue(lines, 'Pages purgeable'), 10) || 0) * pageSize;
267
+ const anonymous = (parseInt(util.getValue(lines, 'Anonymous pages'), 10) || 0) * pageSize;
268
+
269
+ result.active = anonymous - purgeable + wired + compressed;
265
270
  result.reclaimable = (parseInt(util.getValue(lines, 'Pages inactive'), 10) || 0) * pageSize;
266
271
  result.buffcache = result.used - result.active;
267
272
  result.available = result.free + result.buffcache;
273
+
268
274
  }
269
275
  exec('sysctl -n vm.swapusage 2>/dev/null', (error, stdout) => {
270
276
  if (!error) {
package/lib/util.js CHANGED
@@ -1165,7 +1165,7 @@ function promiseAll(promises) {
1165
1165
  }
1166
1166
 
1167
1167
  function promisify(nodeStyleFunction) {
1168
- return () => {
1168
+ return function () {
1169
1169
  const args = Array.prototype.slice.call(arguments);
1170
1170
  return new Promise((resolve, reject) => {
1171
1171
  args.push((err, data) => {
@@ -1181,7 +1181,7 @@ function promisify(nodeStyleFunction) {
1181
1181
  }
1182
1182
 
1183
1183
  function promisifySave(nodeStyleFunction) {
1184
- return () => {
1184
+ return function () {
1185
1185
  const args = Array.prototype.slice.call(arguments);
1186
1186
  return new Promise((resolve) => {
1187
1187
  args.push((err, data) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.31.8",
3
+ "version": "5.31.10",
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)",