systeminformation 5.11.18 → 5.11.21
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/filesystem.js +10 -3
- package/package.json +1 -1
package/lib/filesystem.js
CHANGED
|
@@ -49,12 +49,17 @@ function fsSize(callback) {
|
|
|
49
49
|
return 'HFS';
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
function isLinuxTmpFs(fs) {
|
|
53
|
+
const linuxTmpFileSystems = ['rootfs', 'unionfs', 'squashfs', 'cramfs', 'initrd', 'initramfs', 'devtmpfs', 'tmpfs', 'udev', 'devfs', 'specfs', 'type'];
|
|
54
|
+
return (linuxTmpFileSystems.includes(fs.toLowerCase()));
|
|
55
|
+
}
|
|
56
|
+
|
|
52
57
|
function parseDf(lines) {
|
|
53
58
|
let data = [];
|
|
54
59
|
lines.forEach(function (line) {
|
|
55
60
|
if (line !== '') {
|
|
56
61
|
line = line.replace(/ +/g, ' ').split(' ');
|
|
57
|
-
if (line && ((line[0].startsWith('/')) || (line[6] && line[6] === '/') || (line[0].indexOf('/') > 0) || (line[0].indexOf(':') === 1))) {
|
|
62
|
+
if (line && ((line[0].startsWith('/')) || (line[6] && line[6] === '/') || (line[0].indexOf('/') > 0) || (line[0].indexOf(':') === 1) || !_darwin && !isLinuxTmpFs(line[1]))) {
|
|
58
63
|
const fs = line[0];
|
|
59
64
|
const fsType = ((_linux || _freebsd || _openbsd || _netbsd) ? line[1] : getmacOsFsType(line[0]));
|
|
60
65
|
const size = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[2] : line[1])) * 1024;
|
|
@@ -96,11 +101,12 @@ function fsSize(callback) {
|
|
|
96
101
|
macOsDisks = [];
|
|
97
102
|
}
|
|
98
103
|
}
|
|
99
|
-
if (_linux) { cmd = 'df -lkPTx squashfs | grep -E "^/|^.\\:"';
|
|
104
|
+
if (_linux) { cmd = 'df -lkPTx squashfs'; } // cmd = 'df -lkPTx squashfs | grep -E "^/|^.\\:"';
|
|
100
105
|
if (_freebsd || _openbsd || _netbsd) { cmd = 'df -lkPT'; }
|
|
101
106
|
exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
|
102
107
|
if (!error) {
|
|
103
108
|
let lines = stdout.toString().split('\n');
|
|
109
|
+
if (lines && lines[0] && lines[0].toLowerCase().startsWith('filesystem')) { lines.shift(); }
|
|
104
110
|
data = parseDf(lines);
|
|
105
111
|
if (callback) {
|
|
106
112
|
callback(data);
|
|
@@ -110,6 +116,7 @@ function fsSize(callback) {
|
|
|
110
116
|
exec('df -kPT', { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
|
111
117
|
if (!error) {
|
|
112
118
|
let lines = stdout.toString().split('\n');
|
|
119
|
+
if (lines && lines[0] && lines[0].toLowerCase().startsWith('filesystem')) { lines.shift(); }
|
|
113
120
|
data = parseDf(lines);
|
|
114
121
|
}
|
|
115
122
|
if (callback) {
|
|
@@ -852,7 +859,7 @@ function diskLayout(callback) {
|
|
|
852
859
|
try {
|
|
853
860
|
const outJSON = JSON.parse(out);
|
|
854
861
|
if (outJSON && {}.hasOwnProperty.call(outJSON, 'blockdevices')) {
|
|
855
|
-
devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.
|
|
862
|
+
devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null && item.parttype === null && item.path && item.path.indexOf('/ram') !== 0 && item.path.indexOf('/loop') !== 0 && item['disc-max'] && item['disc-max'] !== 0)); });
|
|
856
863
|
}
|
|
857
864
|
} catch (e) {
|
|
858
865
|
// fallback to older version of lsblk
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.11.
|
|
3
|
+
"version": "5.11.21",
|
|
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)",
|