diff --git a/docs/general.html b/docs/general.html index dfb4fd1..ee3e53e 100644 --- a/docs/general.html +++ b/docs/general.html @@ -205,7 +205,7 @@ si.get(valueObject).then(data => console.log(data));

The key names of the valueObject must be exactly the same as the representing function within systeminformation.

Providing parameters to the get() function

-

Now you can also provide parameters to get() functions (where needed). Just pass the parameters in parentheses right after the wanted keys: have a look at the folloging example:

+

Now you can also provide parameters to get() functions (where needed). Just pass the parameters in parentheses right after the wanted keys: have a look at the following example:

@@ -240,7 +240,7 @@ si.get(valueObject).then(data => console.log(data)); console.log(data));
@@ -258,6 +258,58 @@ si.get(valueObject).then(data => console.log(data));
+

Filter results in get() function

+

You can get even further: if the desired result object is an array, you can filter the object to get only the wanted array item: have a look at the following example:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionResult objectLinuxBSDMacWinSunComments
si.get(valueObject,cb){...}XXXXXexample with filter:
add a pipe symbol with the filter definition
to the given function:
+
Example
+
const si = require('systeminformation');
+
+// define all values, you want to get back
+// here after the keys we define a filter (pipe symbol after the keys)
+// to get only one specific item of the result array
+
+valueObject = {
+  networkInterfaces: 'iface, ip4 | iface:en0'
+}
+si.get(valueObject).then(data => console.log(data));
+
+{
+  networkInterfaces: [
+    {
+      iface: 'en0',
+      ip4: '192.168.0.10'
+    }
+  ]
+}
+              
+

Get All At Once

The following three functions si.getStaticData(), si.getDynamicData() and si.getAllData() will return most of the available data in a single result object:

diff --git a/docs/gettingstarted.html b/docs/gettingstarted.html index 3d0e24a..6bab402 100644 --- a/docs/gettingstarted.html +++ b/docs/gettingstarted.html @@ -47,7 +47,7 @@
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.