diff --git a/CHANGELOG.md b/CHANGELOG.md index d911726..2d77edd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | ------- | ---------- | --------------------------------------------------------------------------------------------------- | +| 5.18.15 | 2023-08-10 | `npm` command extended | | 5.18.14 | 2023-08-09 | `fsSIze()` fixed syntax error | | 5.18.13 | 2023-08-08 | `mem()` fixed error handling | | 5.18.12 | 2023-08-05 | `fsSize()` rw /snap/ issue fixed (linux) | diff --git a/README.md b/README.md index 943ed91..f0d5415 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,15 @@ ## The Systeminformation Project This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 600 versions published, up to 6 mio downloads per month, > 150 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project! +## Please support this project ... ☕️ + +Over the past few years I spent **over 2.000 hours** working on this project and invested in hardware to be able to test on different platforms. Currently I am working very hard on the next **new version 6.0** completely rewritten in TypeScript and with a lot of new features. Any support is highly appreciated - [Buy me a coffee](https://www.buymeacoffee.com/systeminfo). + +**Your contribution** make it possible for me to keep working on this project, add new features and support more platforms. Thank you in advance! + ## New Version 5.0 -The new Version 5 is here - I spent 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 new functionality and several improvements and changes (some of them are breaking changes!): +The new Version 5 is here - this next major version release 5.0 comes with new functionality and several improvements and changes (some of them are breaking changes!): - added audio: get detailed audio device information - added bluetooth: get detailed bluetooth device information @@ -75,9 +79,22 @@ npm install systeminformation --save or simpler ```bash -npm install systeminformation +npm i systeminformation ``` +### Give it a try with `npx`? + +You just want to give it a try - right from your command line without installing it? Here is how you can call it with `npx`: + +``` +# get basic system info (System, OS, CPU) +npx systeminformation info + +# obtain all static data - may take up to 30 seconds +npx systeminformation +``` + + #### Still need Version 4? If you need version 4 (for compatibility reasons), you can install version 4 (latest release) like this diff --git a/docs/history.html b/docs/history.html index 12fd524..49fb468 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.18.15 + 2023-08-10 + npx() command extended + 5.18.14 2023-08-09 diff --git a/docs/index.html b/docs/index.html index a78e255..d69c485 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.18.14
+
New Version: 5.18.15
@@ -204,7 +204,7 @@
-
15,481
+
15,577
Lines of code
@@ -212,7 +212,7 @@
Downloads last month
-
636
+
637
Dependents
diff --git a/lib/cli.js b/lib/cli.js old mode 100644 new mode 100755 index 2ee3346..9b592ef --- a/lib/cli.js +++ b/lib/cli.js @@ -17,15 +17,75 @@ // Dependencies // ---------------------------------------------------------------------------------- const si = require('./index'); +const lib_version = require('../package.json').version; + +function capFirst(string) { + return string[0].toUpperCase() + string.slice(1); +} + +function printLines(obj) { + for (const property in obj) { + console.log(capFirst(property) + ' '.substring(0, 17 - property.length) + ': ' + (obj[property] || '')); + } + console.log(); +} + +function info() { + console.log('┌─────────────────────────────────────────────────────────────────────────────────────────┐'); + console.log('│ SYSTEMINFORMATION '.substring(0, 80 - lib_version.length) + 'Version: ' + lib_version + ' │'); + console.log('└─────────────────────────────────────────────────────────────────────────────────────────┘'); + + si.osInfo().then(res => { + console.log(); + console.log('Operating System:'); + console.log('──────────────────────────────────────────────────────────────────────────────────────────'); + delete res.serial; + delete res.servicepack; + delete res.logofile; + delete res.fqdn; + delete res.uefi; + printLines(res); + si.system().then(res => { + console.log('System:'); + console.log('──────────────────────────────────────────────────────────────────────────────────────────'); + delete res.serial; + delete res.uuid; + delete res.sku; + delete res.uuid; + printLines(res); + si.cpu().then(res => { + console.log('CPU:'); + console.log('──────────────────────────────────────────────────────────────────────────────────────────'); + delete res.cache; + delete res.governor; + delete res.flags; + delete res.virtualization; + delete res.revision; + delete res.voltage; + delete res.vendor; + delete res.speedMin; + delete res.speedMax; + printLines(res); + }); + }); + }); +} // ---------------------------------------------------------------------------------- // Main // ---------------------------------------------------------------------------------- (function () { - si.getStaticData().then( - ((data) => { - data.time = si.time(); - console.log(JSON.stringify(data, null, 2)); - } - )); + const args = process.argv.slice(2); + + if (args[0] === 'info') { + info(); + } else { + si.getStaticData().then( + ((data) => { + data.time = si.time(); + console.log(JSON.stringify(data, null, 2)); + } + )); + } + })();