fixed issue `ersions(), added system openssl version
This commit is contained in:
parent
cc78ec3b0d
commit
c9b8da326f
@ -100,6 +100,7 @@ Other changes
|
||||
|
||||
| Version | Date | Comment |
|
||||
| -------------- | -------------- | -------- |
|
||||
| 3.46.0 | 2018-11-05 | fixed issue `versions()`, added system openssl version |
|
||||
| 3.45.10 | 2018-11-03 | fixed issue `battery()`, modified `package.json` - files |
|
||||
| 3.45.9 | 2018-10-22 | fixed node 4 incompatibility |
|
||||
| 3.45.8 | 2018-10-22 | `system()` fix Raspberry Pi detection |
|
||||
|
||||
@ -59,13 +59,13 @@ async function cpu() {
|
||||
|
||||
(last 7 major and minor version releases)
|
||||
|
||||
- Version 3.46.0: `version()` added system openssl version (besides the one insode node.js)
|
||||
- Version 3.45.0: `diskLayout()` added S.M.A.R.T. status
|
||||
- Version 3.44.0: `battery()` added type, model, manufacturer, serial, timeremaining
|
||||
- Version 3.43.0: added speed per CPU core `cpuCurrentspeed()`
|
||||
- Version 3.42.0: added parent process PID `processes()`
|
||||
- Version 3.41.0: first partial `SunOS` support
|
||||
- Version 3.40.0: extended `versions()` (php, redis, mongodb)
|
||||
- Version 3.39.0: added `versions().mysql` and `versions().nginx`, start implementing `SunOS` support
|
||||
- ...
|
||||
|
||||
You can find all changes here: [detailed changelog][changelog-url]
|
||||
|
||||
@ -276,6 +276,8 @@ function versions(callback) {
|
||||
let result = {
|
||||
kernel: os.release(),
|
||||
openssl: process.versions.openssl,
|
||||
systemOpenssl: '',
|
||||
systemOpensslLib: '',
|
||||
node: process.versions.node,
|
||||
v8: process.versions.v8,
|
||||
npm: '',
|
||||
@ -293,7 +295,7 @@ function versions(callback) {
|
||||
};
|
||||
|
||||
let functionProcessed = (function () {
|
||||
let totalFunctions = 13;
|
||||
let totalFunctions = 14;
|
||||
return function () {
|
||||
if (--totalFunctions === 0) {
|
||||
if (callback) {
|
||||
@ -305,6 +307,15 @@ function versions(callback) {
|
||||
})();
|
||||
|
||||
try {
|
||||
exec('openssl version', function (error, stdout) {
|
||||
if (!error) {
|
||||
let openssl_string = stdout.toString().split('\n')[0].trim();
|
||||
let openssl = openssl_string.split(' ');
|
||||
result.systemOpenssl = openssl.length > 0 ? openssl[1] : openssl[0];
|
||||
result.systemOpensslLib = openssl.length > 0 ? openssl[0] : 'openssl';
|
||||
}
|
||||
functionProcessed();
|
||||
});
|
||||
exec('npm -v', function (error, stdout) {
|
||||
if (!error) {
|
||||
result.npm = stdout.toString().split('\n')[0];
|
||||
@ -313,7 +324,10 @@ function versions(callback) {
|
||||
});
|
||||
exec('pm2 -v', function (error, stdout) {
|
||||
if (!error) {
|
||||
result.pm2 = stdout.toString().split('\n')[0].trim();
|
||||
let pm2 = stdout.toString().split('\n')[0].trim();
|
||||
if (!pm2.startsWith('[PM2]')) {
|
||||
result.pm2 = pm2;
|
||||
}
|
||||
}
|
||||
functionProcessed();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user