Socket
Socket
Sign inDemoInstall

systeminformation

Package Overview
Dependencies
Maintainers
1
Versions
653
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

systeminformation - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

46

lib/index.js

@@ -210,3 +210,3 @@ // ==================================================================================

exports.cpu_speed = function(callback) {
exports.cpu_currentspeed = function(callback) {
var result = {current : tmp_cpu_speed};

@@ -217,3 +217,3 @@ if (tmp_platform == 'Darwin') {

var lines = stdout.toString().split('\n');
result.current = parseInt(lines[0]);
result = parseInt(lines[0]);
}

@@ -231,3 +231,3 @@ callback(result);

var lines = output.toString().split('\n');
result.current = parseInt(lines[0]) * 1000;
result = parseInt(lines[0]) * 1000;
}

@@ -258,3 +258,3 @@ callback(result);

exports.sensors = function(callback) {
exports.cpu_temperature = function(callback) {
var result = {

@@ -264,18 +264,22 @@ main : 0.0,

}
var regex = /\+([^°]*)/g;
exec("sensors", function(error, stdout, stderr) {
if (!error) {
var lines = stdout.toString().split('\n');
lines.forEach(function(line) {
var temps = line.match(regex);
if (line.split(':')[0].toUpperCase().indexOf('PHYSICAL') != -1) {
result.main = parseFloat(temps);
}
if (line.split(':')[0].toUpperCase().indexOf('CORE ') != -1) {
result.cores.push(parseFloat(temps));
}
})
}
callback(result)
});
if (tmp_platform == 'Linux') {
var regex = /\+([^°]*)/g;
exec("sensors", function(error, stdout, stderr) {
if (!error) {
var lines = stdout.toString().split('\n');
lines.forEach(function(line) {
var temps = line.match(regex);
if (line.split(':')[0].toUpperCase().indexOf('PHYSICAL') != -1) {
result.main = parseFloat(temps);
}
if (line.split(':')[0].toUpperCase().indexOf('CORE ') != -1) {
result.cores.push(parseFloat(temps));
}
})
}
callback(result)
});
} else {
callback(result)
}
};

@@ -546,3 +550,3 @@

var idletime = parseFloat(output[1]) / tmp_cores;
result.fullload = (uptime - idletime) / uptime
result.fullload = (uptime - idletime) / uptime * 100.0
callback(result);

@@ -549,0 +553,0 @@ }

{
"name": "systeminformation",
"version": "1.0.1",
"version": "1.0.2",
"description": "Simple system and OS information library",

@@ -5,0 +5,0 @@ "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",

@@ -54,3 +54,3 @@ # systeminformation

| -------------- | ------ | ------ | ------- |
| si.osinfo() | X | X | |
| si.osinfo() | X | X | OS information|
| - platform | X | X | 'Linux' or 'Darwin' |

@@ -64,12 +64,11 @@ | - distro | X | X | |

| - logofile | X | X | e.g. 'apple', 'debian', 'fedora', ... |
| si.cpu() | X | X | |
| - brand | X | X | e.g. 'Intel' |
| si.cpu() | X | X | CPU information|
| - brand | X | X | e.g. 'Intel(R)' |
| - speed | X | X | e.g. '3.40GHz' |
| si.cpu_speed() | X | X | |
| - current | X | X | current speed |
| si.cpu_currentspeed() | X | X | current speed (GHz)|
| si.cores() | X | X | # cores |
| si.sensors() | X | | |
| si.cpu_temperature() | X | | CPU temperature (if sensors is installed) |
| - main | X | X | main temperature |
| - cores | X | X | array of temperatures |
| si.mem() | X | X | |
| si.mem() | X | X | Memory information|
| - total | X | X | |

@@ -76,0 +75,0 @@ | - free | X | X | |

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc