fsSize() available fixed windows and typescript typings

This commit is contained in:
Sebastian Hildebrandt 2021-01-29 15:09:28 +01:00
parent 486b959c1e
commit 284ec8cb8f
7 changed files with 31 additions and 12 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 |
| -------------- | -------------- | -------- | | -------------- | -------------- | -------- |
| 5.0.7 | 2020-01-29 | `fsSize()` available fixed windows and typescript typings |
| 5.0.6 | 2020-01-28 | `osinfo()` added hypervisor (win only) | | 5.0.6 | 2020-01-28 | `osinfo()` added hypervisor (win only) |
| 5.0.5 | 2020-01-27 | `networkInterfaces()` type detection improved (win) | | 5.0.5 | 2020-01-27 | `networkInterfaces()` type detection improved (win) |
| 5.0.4 | 2020-01-27 | `cpu()` improved manufacturer decoding (linux) | | 5.0.4 | 2020-01-27 | `cpu()` improved manufacturer decoding (linux) |

View File

@ -36,13 +36,13 @@ This is amazing. Started as a small project just for myself, it now has > 10,000
The new Version 5 is here - I spend several weeks finalizing this new version. Any support is highly appreciated - [Buy me a coffee](https://www.buymeacoffee.com/systeminfo) The new Version 5 is here - I spend several weeks finalizing this new version. Any support is highly appreciated - [Buy me a coffee](https://www.buymeacoffee.com/systeminfo)
This next major version release 5.0 comes with several optimizations and changes (some of them are breaking changes!): This next major version release 5.0 comes with new functionality and several improvements and changes (some of them are breaking changes!):
- added bluetooth: get detailed bluetooth device information - added bluetooth: get detailed bluetooth device information
- added usb: get detailed usb controller and device information - added usb: get detailed usb controller and device information
- added printer: get information from detected printers - added printer: get information from detected printers
- added audio: get detailed audio device information - added audio: get detailed audio device information
- better uuid function to get unique hardware and os UUIDs - better uuid function to get unique hardware and OS UUIDs
- better/extended cpu info detection - better/extended cpu info detection
- better/extended system info detection - better/extended system info detection
- Apple Silicon M1 support - Apple Silicon M1 support
@ -50,7 +50,7 @@ This next major version release 5.0 comes with several optimizations and changes
- systeminformation website updated and extendet with full documentation and examples [systeminformation.io][systeminformation-url] - systeminformation website updated and extendet with full documentation and examples [systeminformation.io][systeminformation-url]
- lot of minor improvements - lot of minor improvements
Breaking Changes in version 5: you will see several breaking changes for the sake of a more consistent API interface and to be future proof. Read the [detailed Version 5 changes][changes5-url]. Breaking Changes in version 5: you will see several breaking changes for the sake of a more consistent API interface and to be future proof. Read the [detailed version 5 changes][changes5-url].
I did a lot of testing on different platforms and machines but of course there might be some issues that I am not aware of. I would be happy if you inform me when you discover any issues. Issues can be [opened here][new-issue]. I did a lot of testing on different platforms and machines but of course there might be some issues that I am not aware of. I would be happy if you inform me when you discover any issues. Issues can be [opened here][new-issue].
@ -73,7 +73,7 @@ $ npm install systeminformation --save
#### Still need Version 4? #### Still need Version 4?
If you need the lates version 4 release of the package (for compatibility reasons), you can install version 4 (latest release) with If you need version 4 (for compatibility reasons), you can install version 4 (latest release) like this
```bash ```bash
$ npm install systeminformation@4 —save $ npm install systeminformation@4 —save

View File

@ -630,6 +630,16 @@ setInterval(function() {
<td></td> <td></td>
<td>used in bytes</td> <td>used in bytes</td>
</tr> </tr>
<tr>
<td></td>
<td>[0].available</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>available in bytes</td>
</tr>
<tr> <tr>
<td></td> <td></td>
<td>[0].use</td> <td>[0].use</td>
@ -663,6 +673,7 @@ si.fsSize().then(data => console.log(data));</code></pre class="example">
type: 'ext4', type: 'ext4',
size: 972577361920, size: 972577361920,
used: 59142635520, used: 59142635520,
available: 913434726400,
use: 6.08, use: 6.08,
mount: '/' mount: '/'
}, },

View File

@ -56,6 +56,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<th scope="row">5.0.7</th>
<td>2020-01-29</td>
<td><span class="code">fsSize()</span> available fixed windows and typescript typings</td>
</tr>
<tr> <tr>
<th scope="row">5.0.6</th> <th scope="row">5.0.6</th>
<td>2020-01-28</td> <td>2020-01-28</td>

View File

@ -170,7 +170,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>&nbsp;</div> <div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.0.6</span></div> <div class="version">New Version: <span id="version">5.0.7</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">
@ -201,7 +201,7 @@
</div> </div>
<div class="row number-section"> <div class="row number-section">
<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">13,086</div> <div class="numbers">13,096</div>
<div class="title">Lines of code</div> <div class="title">Lines of code</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">

View File

@ -128,12 +128,13 @@ function fsSize(callback) {
if (line !== '') { if (line !== '') {
line = line.trim().split(/\s\s+/); line = line.trim().split(/\s\s+/);
data.push({ data.push({
'fs': line[0], fs: line[0],
'type': line[1], type: line[1],
'size': parseInt(line[3]), size: parseInt(line[3], 10),
'used': parseInt(line[3]) - parseInt(line[2]), used: parseInt(line[3], 10) - parseInt(line[2], 10),
'use': parseFloat((100.0 * (parseInt(line[3]) - parseInt(line[2]))) / parseInt(line[3])), available: parseInt(line[2], 10),
'mount': line[0] use: parseFloat((100.0 * (parseInt(line[3]) - parseInt(line[2]))) / parseInt(line[3])),
mount: line[0]
}); });
} }
}); });

1
lib/index.d.ts vendored
View File

@ -368,6 +368,7 @@ export namespace Systeminformation {
type: string; type: string;
size: number; size: number;
used: number; used: number;
available: number;
use: number; use: number;
mount: string; mount: string;
} }