extended test script, updated docs v5, added USB docs
This commit is contained in:
parent
a10e0f909c
commit
bcf9d46f67
@ -864,7 +864,8 @@ Ubuntu is a trademark of Canonical Ltd., FreeBSD is a registered trademark of Th
|
||||
NetBSD is a registered trademark of The NetBSD Foundation, Docker is a trademark of Docker, Inc., Sun,
|
||||
Solaris, OpenSolaris and registered trademarks of Sun Microsystems, VMware is a trademark of VMware Inc,
|
||||
Virtual Box is a trademark of Oracle Corporation, Xen is a registered trademark of Xen Project,
|
||||
QEMU is a trademark of Fabrice Bellard, bochs is a trademark of The Bochs Project.
|
||||
QEMU is a trademark of Fabrice Bellard, bochs is a trademark of The Bochs Project, USB and USB Logo
|
||||
are trademarks of USB Implementation Forum, Bluetooth and Bluetooth Logo are trademarks of Bluetooth SIG.
|
||||
|
||||
All other trademarks are the property of their respective owners.
|
||||
|
||||
|
||||
@ -282,7 +282,7 @@ si.battery().then(data => console.log(data));</code></pre class="example">
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -123,7 +123,7 @@
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
@ -91,7 +91,7 @@
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -107,7 +107,7 @@
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -596,7 +596,7 @@ si.cpuTemperature().then(data => console.log(data));</code></pre class="example"
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -1060,7 +1060,7 @@
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -867,7 +867,7 @@ setInterval(function() {
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -332,7 +332,7 @@ si.get(valueObject).then(data => console.log(data));</code></pre class="example"
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -152,7 +152,7 @@ async function cpuData() {
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -528,7 +528,7 @@ si.graphics().then(data => console.log(data));</code></pre class="example">
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
<div class="title">Version History</div>
|
||||
<div class="text">
|
||||
<h3>Major and Breaking Changes</h3>
|
||||
<p>To see detaild information on major und breaking changes for version 5.x, refer to the <a href="v5changes.html">Version 5 - Changes</a> page.<br>Be aware version 5 is <strong>NOT fully backward compatible</strong> to version 4.x ...</p>
|
||||
<p>To see detaild information on major und breaking changes for version 5.x, refer to the <a href="changes.html">Version 5 - Changes</a> page.<br>Be aware version 5 is <strong>NOT fully backward compatible</strong> to version 4.x ...</p>
|
||||
|
||||
<h3>Full version history</h3>
|
||||
<table class="table table-sm table-bordered table-striped">
|
||||
@ -2027,7 +2027,7 @@
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -347,7 +347,7 @@
|
||||
<div class="row">
|
||||
<div class="col-12 sectionheader index">
|
||||
<div class="title-small">Breaking Changes - Version 5</div>
|
||||
<div class="text">We made a lot of changes in the new version 5 - some of them are breaking changes. Please refer to the <a href="v5changes.html">Version 5 - Changes</a> page to see a full documentation on changes that you should have a look on.</div>
|
||||
<div class="text">We made a lot of changes in the new version 5 - some of them are breaking changes. Please refer to the <a href="changes.html">Version 5 - Changes</a> page to see a full documentation on changes that you should have a look on.</div>
|
||||
<div class="title-small">Issues</div>
|
||||
<div class="text"><span class="bold">Security issues</span>: Please have a look at our <a href="security.html">security advisories</a></div>
|
||||
<div class="text"><span class="bold">Having an issue</span>: If you run into problems, please check out <a href="issues.html">known issues page</a> first.<br>If you still have problems, please feel free to open an issue on our <a href="https://github.com/sebhildebrandt/systeminformation/issues">github page</a></div>
|
||||
@ -369,7 +369,7 @@
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -400,7 +400,7 @@ si.memLayout().then(data => console.log(data));</code></pre class="example">
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -787,7 +787,7 @@ setInterval(function() {
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -739,7 +739,7 @@ si.users().then(data => console.log(data));</code></pre class="example">
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>si.printer(cb)</td>
|
||||
<td>{...}</td>
|
||||
<td>[{...}]</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
@ -78,7 +78,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>id</td>
|
||||
<td>[0].id</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
@ -88,7 +88,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>name</td>
|
||||
<td>[0].name</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
@ -98,7 +98,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>model</td>
|
||||
<td>[0].model</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
@ -108,7 +108,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>uri</td>
|
||||
<td>[0].uri</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
@ -118,7 +118,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>uuid</td>
|
||||
<td>[0].uuid</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
@ -128,7 +128,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>status</td>
|
||||
<td>[0].status</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
@ -138,7 +138,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>local</td>
|
||||
<td>[0].local</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
@ -148,7 +148,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>default</td>
|
||||
<td>[0].default</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
@ -158,7 +158,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>shared</td>
|
||||
<td>[0].shared</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
@ -223,7 +223,7 @@ si.printer().then(data => console.log(data));</code></pre class="example">
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -725,7 +725,7 @@ si.services('mysql, postgres').then(data => console.log(data));</code></pre clas
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -115,7 +115,7 @@
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -141,7 +141,7 @@ setTimeout(() => {
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -434,7 +434,7 @@ si.chassis().then(data => console.log(data));</code></pre class="example">
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -72,6 +72,8 @@
|
||||
<li><strong>DELL</strong> is a registered trademark of Dell Inc.</li>
|
||||
<li><strong>ASUS</strong> is a registered trademark of ASUSTeK Computer.</li>
|
||||
<li><strong>Alpine</strong> is a trademark of Alpine Linux Development Team.</li>
|
||||
<li><strong>USB and USB Logo</strong> are trademarks of USB Implementation Forum.</li>
|
||||
<li><strong>Bluetooth and Bluetooth Logo</strong> are trademarks of Bluetooth SIG..</li>
|
||||
<li><strong>+innovations</strong> is a trademark of plus-innovations application development GmbH</li>
|
||||
</ul>
|
||||
<p>All other trademarks are the property of their respective owners.</p>
|
||||
@ -97,7 +99,7 @@
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
287
docs/usb.html
Normal file
287
docs/usb.html
Normal file
@ -0,0 +1,287 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.15.1/css/all.css" integrity="sha384-9ZfPnbegQSumzaE7mks2IYgHoayLtuto3AS6ieArECeaR8nCfliJVuLh/GaQ1gyM" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="roboto/css/roboto.css">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<script src="main.js"></script>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/assets/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/assets/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png">
|
||||
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
<title>systeminformation</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="nav">
|
||||
<div class="container">
|
||||
<a href="."><img class="logo float-left" src="assets/logo.png">
|
||||
<div class="title float-left">systeminformation</div>
|
||||
</a>
|
||||
<div class="text float-right github"><a href="https://github.com/sebhildebrandt/systeminformation">View on Github <i class="fab fa-github"></i></a></div>
|
||||
<div class="text float-right todocs"><a href="./#docs">Docs Overview</a></div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-4 col-lg-3 col-xl-2 menu" id="menu">
|
||||
</div>
|
||||
<div class="col-12 col-md-8 col-lg-9 col-xl-10 content">
|
||||
<div class="row">
|
||||
<div class="col-12 sectionheader">
|
||||
<div class="title">USB</div>
|
||||
<div class="text">
|
||||
<p>In this section you will learn how to get information about detected USB devices:</p>
|
||||
<p>For function reference and examples we assume, that we imported <span class="code">systeminformation</span> as follows:</p>
|
||||
<pre><code class="js">const si = require('systeminformation');</code></pre>
|
||||
<h2>Detected USB Devices</h2>
|
||||
<p>All functions in this section return a promise or can be called with a callback function (parameter <span class="code">cb</span> in the function reference)</p>
|
||||
<table class="table table-sm table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Function</th>
|
||||
<th>Result object</th>
|
||||
<th>Linux</th>
|
||||
<th>BSD</th>
|
||||
<th>Mac</th>
|
||||
<th>Win</th>
|
||||
<th>Sun</th>
|
||||
<th>Comments</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>si.usb(cb)</td>
|
||||
<td>[{...}]</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>array detected USB devices</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>[0].bus</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>USB bus</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>[0].deviceId</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>Bus device ID</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>[0].id</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>ID e.g. 0bda:8821</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>[0].name</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>name, e.g. root hub</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>[0].type</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>type e.g. keyboard or mouse</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>[0].removable</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>is removable</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>[0].vendor</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>vendor e.g. Realtek</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>[0].manufacturer</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>manufacturer e.g. Chicony</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>[0].maxPower</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>max power e.g. 100mA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>[0].serialNumber</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>serial number if available</td>
|
||||
</tr>
|
||||
<tr class="example">
|
||||
<td></td>
|
||||
<td colspan="7">
|
||||
<h5>Example</h5>
|
||||
<pre><code class="js">const si = require('systeminformation');
|
||||
si.usb().then(data => console.log(data));</code></pre class="example">
|
||||
<pre class="example">
|
||||
[
|
||||
{
|
||||
bus: 1,
|
||||
deviceId: 2,
|
||||
id: '8087:8001',
|
||||
name: '',
|
||||
type: 'Hub',
|
||||
removable: null,
|
||||
vendor: 'Intel Corp.',
|
||||
manufacturer: '',
|
||||
maxPower: '0mA',
|
||||
serialNumber: null
|
||||
},
|
||||
{
|
||||
bus: 1,
|
||||
deviceId: 1,
|
||||
id: '1d6b:0002',
|
||||
name: '2.0 root hub',
|
||||
type: 'Hub',
|
||||
removable: null,
|
||||
vendor: 'Linux Foundation',
|
||||
manufacturer: 'Linux 4.4.0-169-generic ehci_hcd',
|
||||
maxPower: '0mA',
|
||||
serialNumber: null
|
||||
},
|
||||
{
|
||||
bus: 2,
|
||||
deviceId: 4,
|
||||
id: '04f2:0402',
|
||||
name: 'Genius LuxeMate i200 Keyboard',
|
||||
type: 'Keyboard',
|
||||
removable: null,
|
||||
vendor: 'Chicony Electronics Co., Ltd',
|
||||
manufacturer: 'Chicony',
|
||||
maxPower: '100mA',
|
||||
serialNumber: null
|
||||
},
|
||||
{
|
||||
bus: 2,
|
||||
deviceId: 3,
|
||||
id: '093a:2510',
|
||||
name: 'Optical Mouse',
|
||||
type: 'Mouse',
|
||||
removable: null,
|
||||
vendor: 'Pixart Imaging, Inc.',
|
||||
manufacturer: 'PIXART',
|
||||
maxPower: '100mA',
|
||||
serialNumber: null }
|
||||
]</pre>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<footer class="container-fluid">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="." class="medium home">Home</a></li>
|
||||
<li> </li>
|
||||
<li><a href="security.html">Security Advisories <i class="fas fa-shield-check"></i></a></li>
|
||||
<li><a href="https://github.com/sebhildebrandt/systeminformation">Github <i class="fab fa-github"></i></a></li>
|
||||
<li><a href="https://buymeacoff.ee/systeminfo" class="medium badge bg-primary"><i class="fas fa-coffee"></i> Buy me a coffee</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="contributors.html">Contributors</a></li>
|
||||
<li><a href="trademarks.html">Trademarks</a></li>
|
||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||
<li><a href="https://www.plus-innovations.com">© 2021 Sebastian Hildebrandt</a></li>
|
||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
window.onload = function (e) {
|
||||
createMenu();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -460,7 +460,7 @@
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -237,7 +237,7 @@ si.wifiNetworks().then(data => console.log(data));</code></pre class="example">
|
||||
<div class="col-lg-4 col-12">
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="gettingstarted.html">Quick Start</a></li>
|
||||
<li><a href="v5changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="changes.html">Version 5 Changes</a></li>
|
||||
<li><a href="history.html">Full Version history</a></li>
|
||||
<li><a href="issues.html">Known Issues</a></li>
|
||||
<li><a href="statsfunctions.html">Stats Functions</a></li>
|
||||
|
||||
@ -163,11 +163,13 @@ function inetLatency(host, callback) {
|
||||
});
|
||||
}
|
||||
if (_sunos) {
|
||||
const params = '-s -a ' + hostSanitized + ' 56 2 | grep avg';
|
||||
const params = '-s -a ' + hostSanitized + ' 56 2';
|
||||
const filt = 'avg';
|
||||
execFile('ping', params.split(' '), { timeout: 3000 }, function (error, stdout) {
|
||||
let result = null;
|
||||
if (!error) {
|
||||
const line = stdout.toString().split('=');
|
||||
const lines = stdout.toString().split('\n').filter(line => line.indexOf(filt) >= 0).join('\n');
|
||||
const line = lines.split('=');
|
||||
if (line.length > 1) {
|
||||
const parts = line[1].split('/');
|
||||
if (parts.length > 1) {
|
||||
|
||||
@ -117,6 +117,7 @@ function getDarwinUsbType(name) {
|
||||
else if (name.indexOf(' hub') >= 0) { result = 'Hub'; }
|
||||
else if (name.indexOf('mouse') >= 0) { result = 'Mouse'; }
|
||||
else if (name.indexOf('mic') >= 0) { result = 'Microphone'; }
|
||||
else if (name.indexOf('removable') >= 0) { result = 'Storage'; }
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -140,13 +141,14 @@ function parseDarwinUsb(usb, id) {
|
||||
lines[i] = lines[i].replace(': No,', ': "No",');
|
||||
}
|
||||
const usbObj = JSON.parse(lines.join('\n'));
|
||||
const removableDrive = usbObj['Built-In'].toLowerCase() !== 'yes' && usbObj['non-removable'].toLowerCase() === 'no';
|
||||
|
||||
result.bus = null;
|
||||
result.deviceId = null;
|
||||
result.id = usbObj['USB Address'] || null;
|
||||
result.name = usbObj['kUSBProductString'] || usbObj['USB Product Name'] || null;
|
||||
result.type = getDarwinUsbType((usbObj['kUSBProductString'] || usbObj['USB Product Name'] || '').toLowerCase());
|
||||
result.removable = usbObj['Built-In'].toLowerCase() !== 'yes';
|
||||
result.type = getDarwinUsbType((usbObj['kUSBProductString'] || usbObj['USB Product Name'] || '').toLowerCase() + (removableDrive ? ' removable' : ''));
|
||||
result.removable = usbObj['non-removable'].toLowerCase() === 'no';
|
||||
result.vendor = usbObj['kUSBVendorString'] || usbObj['USB Vendor Name'] || null;
|
||||
result.manufacturer = usbObj['kUSBVendorString'] || usbObj['USB Vendor Name'] || null;
|
||||
result.maxPower = null;
|
||||
|
||||
25
test/si.js
25
test/si.js
@ -3,6 +3,7 @@ const si = require('../lib/index');
|
||||
function test(f) {
|
||||
return new Promise((resolve) => {
|
||||
process.nextTick(() => {
|
||||
// console.log(f);
|
||||
if (f === 'a') { si.audio().then(data => resolve({ data, title: 'Audio' }) )}
|
||||
else if (f === 'b') { si.bios().then(data => resolve({ data, title: 'BIOS' })) }
|
||||
else if (f === 'B') { si.baseboard().then(data => resolve({ data, title: 'Baseboard' })) }
|
||||
@ -37,12 +38,34 @@ function test(f) {
|
||||
else if (f === 'w') { si.wifiNetworks().then(data => resolve({ data, title: 'WIFI Networks' })) }
|
||||
else if (f === 'y') { si.battery().then(data => resolve({ data, title: 'Battery' })) }
|
||||
else if (f === 'z') { si.users().then(data => resolve({ data, title: 'Users' })) }
|
||||
else resolve();
|
||||
else if (f === '1') { si.networkInterfaceDefault().then(data => resolve({ data, title: 'NET Iface Default' })) }
|
||||
else if (f === '2') { si.networkGatewayDefault().then(data => resolve({ data, title: 'NET Gateway Default' })) }
|
||||
else if (f === '3') { si.networkInterfaces().then(data => resolve({ data, title: 'NET Interfaces' })) }
|
||||
else if (f === '4') { si.networkStats().then(data => resolve({ data, title: 'NET Stats' })) }
|
||||
else if (f === '5') { si.networkConnections().then(data => resolve({ data, title: 'NET Connections' })) }
|
||||
else if (f === '6') { si.dockerInfo().then(data => resolve({ data, title: 'Docker Info' })) }
|
||||
else if (f === '7') { si.dockerContainers(true).then(data => resolve({ data, title: 'Docker Containers' })) }
|
||||
else if (f === '8') { si.dockerContainerStats('1').then(data => resolve({ data, title: 'Docker Cont Stats' })) }
|
||||
else if (f === '9') { si.dockerContainerProcesses('1').then(data => resolve({ data, title: 'Docker Cont Processes' })) }
|
||||
else if (f === '0') { si.dockerAll().then(data => resolve({ data, title: 'Docker All' })) }
|
||||
else if (f === '+') { si.getStaticData().then(data => resolve({ data, title: 'All Static Data' })) }
|
||||
else if (f === '-') { si.getDynamicData('apache2, postgres').then(data => resolve({ data, title: 'All Dynamic Data' })) }
|
||||
else if (f === '#') { si.getAllData('apache2, postgres').then(data => resolve({ data, title: 'All Data' })) }
|
||||
else if (f === ',') {
|
||||
const valueObject = {
|
||||
cpu: '*',
|
||||
osInfo: 'platform, release',
|
||||
system: 'model, manufacturer'
|
||||
}
|
||||
si.get(valueObject).then(data => resolve({ data, title: 'Get Object' }))
|
||||
}
|
||||
else resolve('no_key');
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const key = process.argv[2];
|
||||
// console.log(process.argv)
|
||||
|
||||
// console.log(process.argv);
|
||||
|
||||
|
||||
77
test/test.js
77
test/test.js
@ -2,6 +2,9 @@ const readline = require('readline');
|
||||
const util = require('util');
|
||||
const { exec } = require('child_process');
|
||||
|
||||
let waiting = false;
|
||||
let timer;
|
||||
|
||||
function printMenu() {
|
||||
console.log('');
|
||||
console.log('-----------------------------------------------------------------------------------------------------------------------------------');
|
||||
@ -29,28 +32,66 @@ function EnableUserInput() {
|
||||
// }
|
||||
function noop() { }
|
||||
|
||||
process.stdin.on('keypress', (key, data) => {
|
||||
// console.log(data);
|
||||
if (data.name === 'q' && !data.shift) {
|
||||
// shut down
|
||||
process.exit()
|
||||
}
|
||||
function dot() {
|
||||
process.stdout.write('.');
|
||||
}
|
||||
|
||||
exec('node si.js ' + key, (error, stdout) => {
|
||||
try {
|
||||
if (stdout.toString()) {
|
||||
data = JSON.parse(stdout.toString());
|
||||
function startDots() {
|
||||
dot();
|
||||
timer = setInterval(() => {
|
||||
dot();
|
||||
}, 500)
|
||||
}
|
||||
|
||||
function stopDots() {
|
||||
clearInterval(timer);
|
||||
}
|
||||
|
||||
function printTitle(title) {
|
||||
title = '||' + (' ' + title + ' ').substr(0, 36) + '||'
|
||||
console.log('========================================');
|
||||
console.log(title);
|
||||
console.log('========================================');
|
||||
|
||||
}
|
||||
|
||||
process.stdin.on('keypress', (key, data) => {
|
||||
// console.log(data);
|
||||
if (data.name === 'q' && !data.shift) {
|
||||
// shut down
|
||||
process.exit()
|
||||
}
|
||||
|
||||
if (!waiting) {
|
||||
waiting = true;
|
||||
startDots();
|
||||
exec(`node si.js '${key}'`, {timeout: 30000}, (error, stdout) => {
|
||||
waiting = false;
|
||||
stopDots();
|
||||
if (error && error.signal) {
|
||||
console.log();
|
||||
console.log('===============================');
|
||||
console.log('[ ' + data.title + ' ]');
|
||||
console.log('===============================');
|
||||
console.log(util.inspect(data.data, { colors: true, depth: 4 }));
|
||||
printMenu();
|
||||
console.log('TIMEOUT!');
|
||||
} else {
|
||||
try {
|
||||
if (stdout.toString().startsWith('"no_key')) {
|
||||
console.log()
|
||||
console.log('menu item not found - select valid menu item')
|
||||
} else if (stdout.toString()) {
|
||||
data = JSON.parse(stdout.toString());
|
||||
console.log();
|
||||
console.log();
|
||||
printTitle(data.title);
|
||||
console.log(util.inspect(data.data, { colors: true, depth: 4 }));
|
||||
printMenu();
|
||||
}
|
||||
} catch (e) {
|
||||
console.log();
|
||||
console.log('Key: ' + key);
|
||||
console.log('ERROR - UNSUPPORTET');
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
noop();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
printMenu();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user