systeminformation 5.18.5 → 5.18.7
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 +26 -14
- package/lib/graphics.js +35 -32
- package/lib/index.d.ts +2 -0
- package/lib/osinfo.js +20 -14
- package/lib/util.js +6 -2
- package/package.json +1 -1
package/lib/filesystem.js
CHANGED
|
@@ -137,18 +137,26 @@ function fsSize(drive, callback) {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
if (_linux) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
try {
|
|
141
|
+
cmd = 'export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL';
|
|
142
|
+
execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => {
|
|
143
|
+
return line.startsWith('/');
|
|
144
|
+
}).forEach((line) => {
|
|
145
|
+
osMounts[line.split(' ')[0]] = line.toLowerCase().indexOf('rw') >= 0;
|
|
146
|
+
});
|
|
147
|
+
} catch (e) {
|
|
148
|
+
util.noop();
|
|
149
|
+
}
|
|
146
150
|
}
|
|
147
151
|
if (_freebsd || _openbsd || _netbsd) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
+
try {
|
|
153
|
+
cmd = 'df -lkPT';
|
|
154
|
+
execSync('mount').toString().split('\n').forEach((line) => {
|
|
155
|
+
osMounts[line.split(' ')[0]] = line.toLowerCase().indexOf('read-only') === -1;
|
|
156
|
+
});
|
|
157
|
+
} catch (e) {
|
|
158
|
+
util.noop();
|
|
159
|
+
}
|
|
152
160
|
}
|
|
153
161
|
exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
|
154
162
|
let lines = filterLines(stdout);
|
|
@@ -1075,10 +1083,14 @@ function diskLayout(callback) {
|
|
|
1075
1083
|
}
|
|
1076
1084
|
} catch (e) {
|
|
1077
1085
|
// fallback to older version of lsblk
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1086
|
+
try {
|
|
1087
|
+
const out2 = execSync('export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL').toString();
|
|
1088
|
+
let lines = blkStdoutToObject(out2).split('\n');
|
|
1089
|
+
const data = parseBlk(lines);
|
|
1090
|
+
devices = data.filter(item => { return (item.type === 'disk') && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mount === '' && item.label === '' && item.fsType === '')); });
|
|
1091
|
+
} catch (e) {
|
|
1092
|
+
util.noop();
|
|
1093
|
+
}
|
|
1082
1094
|
}
|
|
1083
1095
|
devices.forEach((device) => {
|
|
1084
1096
|
let mediumType = '';
|
package/lib/graphics.js
CHANGED
|
@@ -669,39 +669,42 @@ function graphics(callback) {
|
|
|
669
669
|
} catch (e) {
|
|
670
670
|
util.noop();
|
|
671
671
|
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
result.displays[i]
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
result.displays[i]
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
672
|
+
try {
|
|
673
|
+
stdout = execSync('defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""', { maxBuffer: 1024 * 20000 });
|
|
674
|
+
const output = (stdout || '').toString();
|
|
675
|
+
const obj = util.plistReader(output);
|
|
676
|
+
if (obj['DisplayAnyUserSets'] && obj['DisplayAnyUserSets']['Configs'] && obj['DisplayAnyUserSets']['Configs'][0] && obj['DisplayAnyUserSets']['Configs'][0]['DisplayConfig']) {
|
|
677
|
+
const current = obj['DisplayAnyUserSets']['Configs'][0]['DisplayConfig'];
|
|
678
|
+
let i = 0;
|
|
679
|
+
current.forEach((o) => {
|
|
680
|
+
if (o['CurrentInfo'] && o['CurrentInfo']['OriginX'] !== undefined && result.displays && result.displays[i]) {
|
|
681
|
+
result.displays[i].positionX = o['CurrentInfo']['OriginX'];
|
|
682
|
+
}
|
|
683
|
+
if (o['CurrentInfo'] && o['CurrentInfo']['OriginY'] !== undefined && result.displays && result.displays[i]) {
|
|
684
|
+
result.displays[i].positionY = o['CurrentInfo']['OriginY'];
|
|
685
|
+
}
|
|
686
|
+
i++;
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
if (obj['DisplayAnyUserSets'] && obj['DisplayAnyUserSets'].length > 0 && obj['DisplayAnyUserSets'][0].length > 0 && obj['DisplayAnyUserSets'][0][0]['DisplayID']) {
|
|
690
|
+
const current = obj['DisplayAnyUserSets'][0];
|
|
691
|
+
let i = 0;
|
|
692
|
+
current.forEach((o) => {
|
|
693
|
+
if ('OriginX' in o && result.displays && result.displays[i]) {
|
|
694
|
+
result.displays[i].positionX = o['OriginX'];
|
|
695
|
+
}
|
|
696
|
+
if ('OriginY' in o && result.displays && result.displays[i]) {
|
|
697
|
+
result.displays[i].positionY = o['OriginY'];
|
|
698
|
+
}
|
|
699
|
+
if (o['Mode'] && o['Mode']['BitsPerPixel'] !== undefined && result.displays && result.displays[i]) {
|
|
700
|
+
result.displays[i].pixelDepth = o['Mode']['BitsPerPixel'];
|
|
701
|
+
}
|
|
702
|
+
i++;
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
} catch (e) {
|
|
706
|
+
util.noop();
|
|
703
707
|
}
|
|
704
|
-
|
|
705
708
|
}
|
|
706
709
|
if (callback) {
|
|
707
710
|
callback(result);
|
package/lib/index.d.ts
CHANGED
package/lib/osinfo.js
CHANGED
|
@@ -314,6 +314,7 @@ function osInfo(callback) {
|
|
|
314
314
|
result.codename = (result.release.startsWith('11.') ? 'macOS Big Sur' : result.codename);
|
|
315
315
|
result.codename = (result.release.startsWith('12.') ? 'macOS Monterey' : result.codename);
|
|
316
316
|
result.codename = (result.release.startsWith('13.') ? 'macOS Ventura' : result.codename);
|
|
317
|
+
result.codename = (result.release.startsWith('14.') ? 'macOS Sonoma' : result.codename);
|
|
317
318
|
result.uefi = true;
|
|
318
319
|
result.codepage = util.getCodepage();
|
|
319
320
|
if (callback) {
|
|
@@ -788,23 +789,28 @@ function versions(apps, callback) {
|
|
|
788
789
|
}
|
|
789
790
|
if ({}.hasOwnProperty.call(appsObj.versions, 'python')) {
|
|
790
791
|
if (_darwin) {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
792
|
+
try {
|
|
793
|
+
const stdout = execSync('sw_vers');
|
|
794
|
+
const lines = stdout.toString().split('\n');
|
|
795
|
+
const osVersion = util.getValue(lines, 'ProductVersion', ':');
|
|
796
|
+
const gitHomebrewExists1 = fs.existsSync('/usr/local/Cellar/python');
|
|
797
|
+
const gitHomebrewExists2 = fs.existsSync('/opt/homebrew/bin/python');
|
|
798
|
+
if ((util.darwinXcodeExists() && util.semverCompare('12.0.1', osVersion) < 0) || gitHomebrewExists1 || gitHomebrewExists2) {
|
|
799
|
+
const cmd = gitHomebrewExists1 ? '/usr/local/Cellar/python -V 2>&1' : (gitHomebrewExists2 ? '/opt/homebrew/bin/python -V 2>&1' : 'python -V 2>&1');
|
|
800
|
+
exec(cmd, function (error, stdout) {
|
|
801
|
+
if (!error) {
|
|
802
|
+
const python = stdout.toString().split('\n')[0] || '';
|
|
803
|
+
appsObj.versions.python = python.toLowerCase().replace('python', '').trim();
|
|
804
|
+
}
|
|
805
|
+
functionProcessed();
|
|
806
|
+
});
|
|
807
|
+
} else {
|
|
803
808
|
functionProcessed();
|
|
804
|
-
}
|
|
805
|
-
}
|
|
809
|
+
}
|
|
810
|
+
} catch (e) {
|
|
806
811
|
functionProcessed();
|
|
807
812
|
}
|
|
813
|
+
|
|
808
814
|
} else {
|
|
809
815
|
exec('python -V 2>&1', function (error, stdout) {
|
|
810
816
|
if (!error) {
|
package/lib/util.js
CHANGED
|
@@ -586,8 +586,12 @@ function smartMonToolsInstalled() {
|
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
588
|
if (_linux || _darwin || _freebsd || _openbsd || _netbsd) {
|
|
589
|
-
|
|
590
|
-
|
|
589
|
+
try {
|
|
590
|
+
const pathArray = execSync('which smartctl 2>/dev/null', execOptsWin).toString().split('\r\n');
|
|
591
|
+
_smartMonToolsInstalled = pathArray.length > 0;
|
|
592
|
+
} catch (e) {
|
|
593
|
+
util.noop();
|
|
594
|
+
}
|
|
591
595
|
}
|
|
592
596
|
return _smartMonToolsInstalled;
|
|
593
597
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.7",
|
|
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)",
|