systeminformation 5.24.4 → 5.24.6
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 +1 -1
- package/lib/cpu.js +1 -0
- package/lib/users.js +11 -3
- package/lib/util.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1186,7 +1186,7 @@ All other trademarks are the property of their respective owners.
|
|
|
1186
1186
|
[daviddm-url]: https://david-dm.org/sebhildebrandt/systeminformation
|
|
1187
1187
|
[issues-img]: https://img.shields.io/github/issues/sebhildebrandt/systeminformation.svg?style=flat-square
|
|
1188
1188
|
[issues-url]: https://github.com/sebhildebrandt/systeminformation/issues
|
|
1189
|
-
[closed-issues-img]: https://img.shields.io/github/issues-
|
|
1189
|
+
[closed-issues-img]: https://img.shields.io/github/issues-search?query=repo%3Asebhildebrandt/systeminformation+is%3Aclosed&style=flat-square&color=brightgreen&label=Issues+closed
|
|
1190
1190
|
[closed-issues-url]: https://github.com/sebhildebrandt/systeminformation/issues?q=is%3Aissue+is%3Aclosed
|
|
1191
1191
|
[new-issue]: https://github.com/sebhildebrandt/systeminformation/issues/new/choose
|
|
1192
1192
|
[mmon-npm-url]: https://npmjs.org/package/mmon
|
package/lib/cpu.js
CHANGED
|
@@ -737,6 +737,7 @@ function getCpu() {
|
|
|
737
737
|
}
|
|
738
738
|
modelline = util.getValue(lines, 'model name') || modelline;
|
|
739
739
|
modelline = util.getValue(lines, 'bios model name') || modelline;
|
|
740
|
+
modelline = util.cleanString(modelline);
|
|
740
741
|
const modellineParts = modelline.split('@');
|
|
741
742
|
result.brand = modellineParts[0].trim();
|
|
742
743
|
result.speed = modellineParts[1] ? parseFloat(modellineParts[1].trim()) : 0;
|
package/lib/users.js
CHANGED
|
@@ -105,10 +105,18 @@ function parseUsersDarwin(lines) {
|
|
|
105
105
|
|
|
106
106
|
// who part
|
|
107
107
|
if (is_whopart) {
|
|
108
|
+
let dt = ('' + new Date().getFullYear()) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
|
|
109
|
+
try {
|
|
110
|
+
if (new Date(dt) > new Date) {
|
|
111
|
+
dt = ('' + (new Date().getFullYear() - 1)) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
|
|
112
|
+
}
|
|
113
|
+
} catch {
|
|
114
|
+
util.noop();
|
|
115
|
+
}
|
|
108
116
|
result_who.push({
|
|
109
117
|
user: l[0],
|
|
110
118
|
tty: l[1],
|
|
111
|
-
date:
|
|
119
|
+
date: dt,
|
|
112
120
|
time: l[4],
|
|
113
121
|
});
|
|
114
122
|
} else {
|
|
@@ -146,7 +154,7 @@ function users(callback) {
|
|
|
146
154
|
|
|
147
155
|
// linux
|
|
148
156
|
if (_linux) {
|
|
149
|
-
exec('who --ips; echo "---"; w | tail -n +2', function (error, stdout) {
|
|
157
|
+
exec('export LC_ALL=C; who --ips; echo "---"; w; unset LC_ALL | tail -n +2', function (error, stdout) {
|
|
150
158
|
if (!error) {
|
|
151
159
|
// lines / split
|
|
152
160
|
let lines = stdout.toString().split('\n');
|
|
@@ -195,7 +203,7 @@ function users(callback) {
|
|
|
195
203
|
}
|
|
196
204
|
|
|
197
205
|
if (_darwin) {
|
|
198
|
-
exec('who; echo "---"; w -ih', function (error, stdout) {
|
|
206
|
+
exec('export LC_ALL=C; who; echo "---"; w -ih; unset LC_ALL', function (error, stdout) {
|
|
199
207
|
if (!error) {
|
|
200
208
|
// lines / split
|
|
201
209
|
let lines = stdout.toString().split('\n');
|
package/lib/util.js
CHANGED
|
@@ -2535,6 +2535,9 @@ function checkWebsite(url, timeout = 5000) {
|
|
|
2535
2535
|
});
|
|
2536
2536
|
};
|
|
2537
2537
|
|
|
2538
|
+
function cleanString(str) {
|
|
2539
|
+
return str.replace(/To Be Filled By O.E.M./g, '');
|
|
2540
|
+
}
|
|
2538
2541
|
function noop() { }
|
|
2539
2542
|
|
|
2540
2543
|
exports.toInt = toInt;
|
|
@@ -2591,3 +2594,4 @@ exports.getFilesInPath = getFilesInPath;
|
|
|
2591
2594
|
exports.semverCompare = semverCompare;
|
|
2592
2595
|
exports.getAppleModel = getAppleModel;
|
|
2593
2596
|
exports.checkWebsite = checkWebsite;
|
|
2597
|
+
exports.cleanString = cleanString;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.24.
|
|
3
|
+
"version": "5.24.6",
|
|
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)",
|