systeminformation 5.33.3 → 5.33.5
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 +3 -2
- package/lib/filesystem.js +18 -1
- package/lib/osinfo.js +1 -0
- package/lib/util.js +10 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -84,15 +84,16 @@ If you want to run the whole test locally on your machines (without writing any
|
|
|
84
84
|
git clone -b v6 https://github.com/sebhildebrandt/systeminformation.git
|
|
85
85
|
cd systeminformation
|
|
86
86
|
|
|
87
|
-
# install dev dependencies
|
|
87
|
+
# install dev dependencies and build
|
|
88
88
|
npm ci
|
|
89
|
+
npm run build
|
|
89
90
|
|
|
90
91
|
# run tests
|
|
91
92
|
npm run ci # for the whole test run
|
|
92
93
|
npm run test # for testing individual functions
|
|
93
94
|
```
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
Thank you for testing and reporting! Please report any issue with the prefix "v6.beta.0: "
|
|
96
97
|
|
|
97
98
|
## Current Version 5.0
|
|
98
99
|
|
package/lib/filesystem.js
CHANGED
|
@@ -1729,12 +1729,29 @@ function diskLayout(callback) {
|
|
|
1729
1729
|
util.noop();
|
|
1730
1730
|
}
|
|
1731
1731
|
}
|
|
1732
|
+
function hasControlCharacters(str) {
|
|
1733
|
+
return /\p{Cc}/u.test(str);
|
|
1734
|
+
}
|
|
1732
1735
|
util.promiseAll(workload).then((data) => {
|
|
1733
1736
|
let devices = data.results[0].toString().split(/\n\s*\n/);
|
|
1734
1737
|
devices.forEach((device) => {
|
|
1735
1738
|
const lines = device.split('\r\n');
|
|
1736
1739
|
const size = util.getValue(lines, 'Size', ':').trim();
|
|
1737
1740
|
const status = util.getValue(lines, 'Status', ':').trim().toLowerCase();
|
|
1741
|
+
let serialNum = util.getValue(lines, 'SerialNumber', ':').trim();
|
|
1742
|
+
if (hasControlCharacters(serialNum)) {
|
|
1743
|
+
const instanceId = util.getValue(lines, 'PNPDeviceId', ':').trim().split('\\')[2];
|
|
1744
|
+
if (instanceId) {
|
|
1745
|
+
const parts = instanceId.split('&');
|
|
1746
|
+
// instanceId can contain device serial number or be generated by PnP manager
|
|
1747
|
+
// in first case it will be "<serial number>&0"
|
|
1748
|
+
// in second case it will be opaque generated value that looks like this: "5&<8-symbol hex code>&0&000000"
|
|
1749
|
+
// https://learn.microsoft.com/en-us/windows-hardware/drivers/install/instance-ids
|
|
1750
|
+
if (parts.length == 2 && parts[1] === '0') {
|
|
1751
|
+
serialNum = parts[0]
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1738
1755
|
if (size) {
|
|
1739
1756
|
result.push({
|
|
1740
1757
|
device: util.getValue(lines, 'DeviceId', ':'), // changed from PNPDeviceId to DeviceID (be be able to match devices)
|
|
@@ -1750,7 +1767,7 @@ function diskLayout(callback) {
|
|
|
1750
1767
|
tracksPerCylinder: parseInt(util.getValue(lines, 'TracksPerCylinder', ':'), 10),
|
|
1751
1768
|
sectorsPerTrack: parseInt(util.getValue(lines, 'SectorsPerTrack', ':'), 10),
|
|
1752
1769
|
firmwareRevision: util.getValue(lines, 'FirmwareRevision', ':').trim(),
|
|
1753
|
-
serialNum
|
|
1770
|
+
serialNum,
|
|
1754
1771
|
interfaceType: util.getValue(lines, 'InterfaceType', ':').trim(),
|
|
1755
1772
|
smartStatus: status === 'ok' ? 'Ok' : status === 'degraded' ? 'Degraded' : status === 'pred fail' ? 'Predicted Failure' : 'Unknown',
|
|
1756
1773
|
temperature: null
|
package/lib/osinfo.js
CHANGED
|
@@ -336,6 +336,7 @@ function osInfo(callback) {
|
|
|
336
336
|
result.codename = result.release.startsWith('14.') ? 'Sonoma' : result.codename;
|
|
337
337
|
result.codename = result.release.startsWith('15.') ? 'Sequoia' : result.codename;
|
|
338
338
|
result.codename = result.release.startsWith('26.') ? 'Tahoe' : result.codename;
|
|
339
|
+
result.codename = result.release.startsWith('27.') ? 'Golden Gate' : result.codename;
|
|
339
340
|
result.uefi = true;
|
|
340
341
|
result.codepage = util.getCodepage();
|
|
341
342
|
if (callback) {
|
package/lib/util.js
CHANGED
|
@@ -202,7 +202,14 @@ function parseTime(t, pmDesignator) {
|
|
|
202
202
|
parts[1] += parts[2];
|
|
203
203
|
}
|
|
204
204
|
const p1 = (parts[1] || '').toLowerCase();
|
|
205
|
-
let isPM =
|
|
205
|
+
let isPM =
|
|
206
|
+
p1.indexOf('pm') > -1 ||
|
|
207
|
+
p1.indexOf('p.m.') > -1 ||
|
|
208
|
+
p1.indexOf('p. m.') > -1 ||
|
|
209
|
+
p1.indexOf('n') > -1 ||
|
|
210
|
+
p1.indexOf('ch') > -1 ||
|
|
211
|
+
p1.indexOf('ös') > -1 ||
|
|
212
|
+
(pmDesignator && p1.indexOf(pmDesignator) > -1);
|
|
206
213
|
hour = parseInt(parts[0], 10);
|
|
207
214
|
min = parseInt(parts[1], 10);
|
|
208
215
|
hour = isPM && hour < 12 ? hour + 12 : hour;
|
|
@@ -1430,6 +1437,8 @@ function semverCompare(v1, v2) {
|
|
|
1430
1437
|
return res;
|
|
1431
1438
|
}
|
|
1432
1439
|
|
|
1440
|
+
// Mac model name and serial number / model identifier
|
|
1441
|
+
|
|
1433
1442
|
function getAppleModel(key) {
|
|
1434
1443
|
const appleModelIds = [
|
|
1435
1444
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.33.
|
|
3
|
+
"version": "5.33.5",
|
|
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)",
|