From 564904e756b7266722a9102947f8a1f998d28b37 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Fri, 10 Jan 2020 22:36:32 +0100 Subject: [PATCH] memLayout() fix memsize linux (modules >= 32 GB) --- CHANGELOG.md | 1 + README.md | 2 +- docs/history.html | 5 +++++ docs/index.html | 4 ++-- lib/memory.js | 4 +++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f8e479..411041d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.18.2 | 2020-01-10 | `memLayout()` fix memsize linux (modules >= 32 GB) | | 4.18.1 | 2020-01-07 | updated docs | | 4.18.0 | 2020-01-07 | `networkInterfaces()` added dhcp for mac os, added dhcp linux fallback | | 4.17.3 | 2020-01-05 | code cleanup | diff --git a/README.md b/README.md index c98bc64..fa31145 100644 --- a/README.md +++ b/README.md @@ -98,13 +98,13 @@ si.cpu() (last 7 major and minor version releases) +- Version 4.18.0: `networkInterfaces()` added dhcp for mac os, added dhcp linux fallback - Version 4.17.0: `networkInterfaces()` added dhcp, dnsSuffix, ieee8021xAuth, ieee8021xState - Version 4.16.0: `networkGatewayDefault()` added - Version 4.15.0: `cpu()` added governor (linux) - Version 4.14.0: `processes()` added process path and params - Version 4.13.0: `networkConnections()` added PID, process - Version 4.12.0: `networkInterfaces()` added property virtual -- Version 4.11.0: `wifiNetworks()` added available wifi networks - ... You can find all changes here: [detailed changelog][changelog-url] diff --git a/docs/history.html b/docs/history.html index 2241e70..b2bf6a5 100644 --- a/docs/history.html +++ b/docs/history.html @@ -83,6 +83,11 @@ + + 4.18.2 + 2020-01-10 + memLayout() fix memsize linux (modules >= 32 GB) + 4.18.1 2020-01-07 diff --git a/docs/index.html b/docs/index.html index fee2bad..fd3adb2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,7 @@
systeminformation
-
Current Version: 4.18.1
+
Current Version: 4.18.2
@@ -199,7 +199,7 @@
Downloads last month
-
234
+
235
Dependends
diff --git a/lib/memory.js b/lib/memory.js index bf7e9ee..0edf316 100644 --- a/lib/memory.js +++ b/lib/memory.js @@ -281,9 +281,11 @@ function memLayout(callback) { devices.shift(); devices.forEach(function (device) { let lines = device.split('\n'); + const sizeString = util.getValue(lines, 'Size'); + const size = sizeString.indexOf('GB') >= 0 ? parseInt(sizeString, 10) * 1024 * 1024 * 1024 : parseInt(sizeString, 10) * 1024 * 1024; if (parseInt(util.getValue(lines, 'Size'), 10) > 0) { result.push({ - size: parseInt(util.getValue(lines, 'Size'), 10) * 1024 * 1024, + size, bank: util.getValue(lines, 'Bank Locator'), type: util.getValue(lines, 'Type:'), clockSpeed: (util.getValue(lines, 'Configured Clock Speed:') ? parseInt(util.getValue(lines, 'Configured Clock Speed:'), 10) : (util.getValue(lines, 'Speed:') ? parseInt(util.getValue(lines, 'Speed:'), 10) : -1)),