versions() added dotnet, typings fix

This commit is contained in:
Sebastian Hildebrandt 2020-03-01 21:36:47 +01:00
parent 2f9874e0b5
commit cf788499b1
6 changed files with 23 additions and 8 deletions

View File

@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
| Version | Date | Comment | | Version | Date | Comment |
| -------------- | -------------- | -------- | | -------------- | -------------- | -------- |
| 4.22.4 | 2020-03-01 | `versions()` added dotnet, typings fix |
| 4.22.3 | 2020-02-20 | `memLayout()` code cleanup | | 4.22.3 | 2020-02-20 | `memLayout()` code cleanup |
| 4.22.2 | 2020-02-19 | `memLayout()` raspberry PI mem voltage fix | | 4.22.2 | 2020-02-19 | `memLayout()` raspberry PI mem voltage fix |
| 4.22.1 | 2020-02-17 | `memLayout()` raspberry PI support | | 4.22.1 | 2020-02-17 | `memLayout()` raspberry PI support |

View File

@ -30,7 +30,7 @@
[![Sponsoring][sponsor-badge]][sponsor-url] [![Sponsoring][sponsor-badge]][sponsor-url]
[![MIT license][license-img]][license-url] [![MIT license][license-img]][license-url]
This is amazing. Started as a small project just for myself, it now has > 9,000 lines of code, > 250 versions published, up to 1 mio downloads per month, > 5 mio downloads overall. Thank you to all who contributed to this project! This is amazing. Started as a small project just for myself, it now has > 9,000 lines of code, > 300 versions published, up to 1 mio downloads per month, > 6 mio downloads overall. Thank you to all who contributed to this project!
## New Version 4.0 ## New Version 4.0

View File

@ -83,6 +83,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<th scope="row">4.22.4</th>
<td>2020-03-01</td>
<td><span class="code">versions()</span> added dotnet, fix typings</td>
</tr>
<tr> <tr>
<th scope="row">4.22.3</th> <th scope="row">4.22.3</th>
<td>2020-02-20</td> <td>2020-02-20</td>

View File

@ -168,7 +168,7 @@
<img class="logo" src="assets/logo.png"> <img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div> <div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span></div> <div class="subtitle"><span id="typed"></span></div>
<div class="version">Current Version: <span id="version">4.22.3</span></div> <div class="version">Current Version: <span id="version">4.22.4</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button> <button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div> </div>
<div class="down"> <div class="down">
@ -207,7 +207,7 @@
<div class="title">Downloads last month</div> <div class="title">Downloads last month</div>
</div> </div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12"> <div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">248</div> <div class="numbers">249</div>
<div class="title">Dependends</div> <div class="title">Dependends</div>
</div> </div>
</div> </div>

7
lib/index.d.ts vendored
View File

@ -83,9 +83,9 @@ export namespace Systeminformation {
} }
interface CpuCurrentSpeedData { interface CpuCurrentSpeedData {
min: string; min: number;
max: string; max: number;
avg: string; avg: number;
cores: number[]; cores: number[];
} }
@ -243,6 +243,7 @@ export namespace Systeminformation {
java: string; java: string;
gcc: string; gcc: string;
virtualbox: string; virtualbox: string;
dotnet: string;
} }
interface UserData { interface UserData {

View File

@ -384,11 +384,12 @@ function versions(callback) {
pip3: '', pip3: '',
java: '', java: '',
gcc: '', gcc: '',
virtualbox: '' virtualbox: '',
dotnet: ''
}; };
let functionProcessed = (function () { let functionProcessed = (function () {
let totalFunctions = 25; let totalFunctions = 26;
return function () { return function () {
if (--totalFunctions === 0) { if (--totalFunctions === 0) {
if (callback) { if (callback) {
@ -694,6 +695,13 @@ function versions(callback) {
} }
functionProcessed(); functionProcessed();
}); });
exec('dotnet --version 2>&1', function (error, stdout) {
if (!error) {
const dotnet = stdout.toString().split('\n')[0] || '';
result.dotnet = dotnet.trim();
}
functionProcessed();
});
} catch (e) { } catch (e) {
if (callback) { callback(result); } if (callback) { callback(result); }
resolve(result); resolve(result);