From dae9b9348c885413a903cc90defc26989ac5bb03 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Mon, 25 Jan 2021 19:03:20 +0100 Subject: [PATCH] updated docs v5 --- README.md | 2 +- docs/changes.html | 159 +++++++++++++++++++++++++++++++++++++++------- docs/docker.html | 6 +- docs/index.html | 4 +- docs/tests.html | 10 +-- lib/printer.js | 5 +- 6 files changed, 150 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index cd54d74..d6d7be9 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Breaking Changes in version 4: you will see some minor breaking changes. Read th ## Quick Start -Lightweight collection of 40+ functions to retrieve detailed hardware, system and OS information. +Lightweight collection of 45+ functions to retrieve detailed hardware, system and OS information. - simple to use - get detailed information about system, cpu, baseboard, battery, memory, disks/filesystem, network, docker, software, services and processes diff --git a/docs/changes.html b/docs/changes.html index 8363144..bd84407 100644 --- a/docs/changes.html +++ b/docs/changes.html @@ -43,32 +43,142 @@
Major and Breaking Changes
-

Major Changes - Version 5

+

Major Changes - Version 5

New Functions

    -
  • chassis() chassis information
  • -
  • vboxInfo() detailed virtualBox VM information
  • -
  • wifiNetworks() detailed information about available wifi networks
  • +
  • audio() detailed audio information
  • +
  • printers() detailed printer information
  • +
  • usb() detailed USB information
  • +
  • bluetoothDevices() detailed information detected bluetooth devices

Breaking Changes

+

Be aware, that the new version 5.x is NOT fully backward compatible to version 4.x ...

+

We had to make several interface changes to keep systeminformation as consistent as possible. We highly recommend to go go through the complete list to adapt your own code to be again compatible to the new version 5:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionOldNew (V5)Comments
unsupported values-1nullvalues which are unknown or unsupported
on platform
processLoad()result as objectresult as array of objectsfunction now allows to provide more than
one process (as a comma separated list)
cpu()speedmin
speedmax
speedMin
speedMax
pascalCase conformity
cpu().speed
cpu().speedMin
cpu().speedMax
string valuesnow returning
numerical values
better value handling
cpuCurrentspeed()cpuCurrentSpeed()function name changed
pascalCase conformity
blockDevices()fstypefsTypepascalCase conformity
graphics().displaypixeldepth
resolutionx
resolutiony
sizex
sizey
pixelDepth
resolutionX
resolutionY
sizeX
sizeY
pascalCase conformity
battery()hasbattery
cyclecount
ischarging
designedcapacity
maxcapacity
acconnected
timeremaining
hasBattery
cycleCount
isCharging
designedCapacity
maxCapacity
acConnected
timeRemaining
pascalCase conformity
networkConnections()localaddress
localport
peeraddress
peerport
localAddress
localPort
peerAddress
peerPort
pascalCase conformity
currentLoad()avgload
currentload
currentload_user
currentload_system
currentload_nice
currentload_idle
currentload_irq
raw_currentload
avgLoad
currentLoad
currentLoadUser
currentLoadSystem
currentLoadNice
currentLoadIdle
currentLoadIrq
rawCurrentLoad
pascalCase conformity
processes()mem_vsz
mem_rss
pcpu
pcpuu
pcpus
pmem
memVsz
memRss
cpu
cpuu
cpus
mem
pascalCase conformity
renamed attributes
services()pcpu
pmem
cpu
mem
renamed attributes
dockerContainerStats()mem_usage
mem_limit
mem_percent
cpu_percent
cpu_stats
precpu_stats
memory_stats
memUsage
memLimit
memPercent
cpuPercent
cpuStats
precpuStats
memoryStats
pascalCase conformity
dockerContainerProcesses()pid_hostpidHostpascalCase conformity
vbox()HPET
PAE
APIC
X2APIC
ACPI
IOAPIC
biosAPICmode
TRC
hpet
pae
apic
x2Apic
acpi
ioApic
biosApicMode
rtc
pascalCase conformity
+

I know, these are a lot of changes, but for the sake of a consistent interface and to be future proof, we think that this was necessary. Thynk you for your understanding.

+

Other Improvements and Changes

    -
  • networkStats(): will provide an array of stats for all given interfaces. In previous versions only one interface was provided as a parameter. Pass '*' for all interfaces
  • -
  • networkStats(): rx and tx changed to rx_bytes and tx_bytes
  • -
  • dockerContainerStats() will provide an array of stats for all given docker containers. In previous versions only one interface was provided as a parameter. Pass '*' for all docker containers
  • +
  • cpu(): extended AMD processor list
  • +
  • cpu(): extended socket list (win)
  • +
  • cpu(): added virtualization if cpu supports virtualization
  • +
  • cpu(): now flags are part of this function
  • +
  • graphics(): extended nvidia-smi parsing
  • +
  • system(): better Raspberry PI detection
  • +
  • system(): added virtual and virtualHost (if system is virtual instance)
  • +
  • fsSize(): added available
  • +
  • fsSize(): improved calculation of used
  • +
  • osInfo(): better fqdn (win)
  • +
  • uuid(): better value support
  • +
  • uuid(): added MACs, Raspberry Pi hardware ID
  • +
  • uuid(): better Raspberry Pi hardware ID
  • +
  • getData(): support for pasing parameters and filters (see section getData)
  • +
  • Apple M1 Silicon extended support (now ereything supported exept of cpu temperature)
  • +
  • updated TypeScript definitions
-

Other Changes

-
    -
  • system(): optimized system detection (e.g. new Raspberry Pi models, ...)
  • -
  • system(), bios(), baseboard(): information also as non-root (linux)
  • -
  • graphics(): added pip, pip3, virtualBox,
  • -
  • versions(): better controller and display detection, fixes
  • -
  • networkInterfaces(): optimization, fixes
  • -
  • networkStats() added operstate, type, duplex, mtu, speed, carrierChanges
  • -
  • added TypeScript definitions
  • -
-

Be aware, that the new version 5.x is NOT fully backward compatible to version 4.x ...

- -

Major Changes - Version 4

+

Test full functionality and view Version 5 results

+

If you want to see all function results on your machine, please head over to Testing section. Here you can easily test all functions without coding.

+

Major Changes - Version 4

New Functions

  • chassis() chassis information
  • @@ -92,14 +202,15 @@
  • added TypeScript definitions

Be aware, that the new version 4.x is NOT fully backward compatible to version 3.x ...

-

Major Changes - Version 3

+

Major Changes - Version 3

  • works only with node.js v4.0.0 and above (using now internal ES6 promise function, arrow functions, ...)
  • Promises. As you can see in the documentation, you can now also use it in a promise oriented way. But callbacks are still supported.
  • Async/Await. Due to the promises support, systeminformation also works perfectly with the `async/await` pattern (available in node.js v7.6.0 and above). See example in the docs.
-

Full version history

-

Full version histrory can be viewed here

+
+

Full version history

+

Full version histrory (every single release version from version 1.x.x to 5.x.x) can be viewed here

@@ -153,4 +264,4 @@ - + \ No newline at end of file diff --git a/docs/docker.html b/docs/docker.html index 97b6bc9..849bd01 100644 --- a/docs/docker.html +++ b/docs/docker.html @@ -848,13 +848,13 @@ - percpuStats + precpuStats X X X X X - detailed per cpu stats + cpu statistic of previous read @@ -1089,4 +1089,4 @@ - + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index bec691a..2140f8b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -227,6 +227,8 @@
Documentation
Detailed documentation and reference for version 5.x.x
+
Breaking Changes - Version 5
+
We made a lot of improvements and changes in the new version. Version 5 is NOT fully backward compatible to version 4! Be aware, there are some breaking changes. Please refer to the Version 5 - Changes page to see a full documentation of all changes you should have a look on.
@@ -346,8 +348,6 @@
-
Breaking Changes - Version 5
-
We made a lot of changes in the new version 5 - some of them are breaking changes. Please refer to the Version 5 - Changes page to see a full documentation on changes that you should have a look on.
Issues
Security issues: Please have a look at our security advisories
Having an issue: If you run into problems, please check out known issues page first.
If you still have problems, please feel free to open an issue on our github page
diff --git a/docs/tests.html b/docs/tests.html index 046cdf0..5170480 100644 --- a/docs/tests.html +++ b/docs/tests.html @@ -59,7 +59,7 @@

Now you can start the test with

npm run test

You get a nice menu where you now can run function by function and see if you get meaningfull results (if supported on yur platform) or errors. Sample output:

-
SYSTEMINFORMATION - Test Scripts - Version: 5.X
+              
SYSTEMINFORMATION - Test Scripts - Version: 5.x.y
 ═══════════════════════════════════════════════════════════
 
 ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
@@ -78,9 +78,9 @@
 └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Press q to exit the test suite

Here a sample output for the e.g. c ... CPU

-
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
-┃  CPU                                  v: 5.x.y ┃
-┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
+              
┌────────────────────────────────────────────────┐
+│  CPU                                  v: 5.x.y │
+└────────────────────────────────────────────────┘
 {
   manufacturer: 'Intel®',
   brand: 'Core™ i7-8569U',
@@ -155,4 +155,4 @@
   
 
 
-
+
\ No newline at end of file
diff --git a/lib/printer.js b/lib/printer.js
index 040cb34..05265a2 100644
--- a/lib/printer.js
+++ b/lib/printer.js
@@ -190,7 +190,10 @@ function printer(callback) {
           if (!error) {
             const parts = stdout.toString().split(/\n\s*\n/);
             for (let i = 0; i < parts.length; i++) {
-              result.push(parseWindowsPrinters(parts[i].split('\n'), i));
+              const printer = parseWindowsPrinters(parts[i].split('\n'), i);
+              if (printer.name || printer.model) {
+                result.push(parseWindowsPrinters(parts[i].split('\n'), i));
+              }
             }
           }
           if (callback) {