How to use the systeminformation.cpuTemperature function in systeminformation

To help you get started, we’ve selected a few systeminformation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sykeben / RasDash / api.js View on Github external
api.get('/cpu/temp', function(req, res) { // CPU Temperature in C (cpu/temp)
  si.cpuTemperature()
    .then(data => res.send(data.main.toString()))
    .catch(error => res.status(404).send(siError))
})
api.get('/cpu/usage', function(req, res) { // CPU Usage % (cpu/usage)
github lukechadwick / linux-intel-undervolt-gui / app / components / CpuInfo.js View on Github external
let intervalId = setInterval(() => {
      si.currentLoad().then(data => {
        this.setState({ load: data });
      });

      si.cpuCurrentspeed().then(data => {
        this.setState({ speed: data });
      });

      si.cpuTemperature()
        .then(data => {
          this.setState({ temp: data });
        })

        .catch(error => console.error(error));
    }, 1000);
    this.setState({ intervalId: intervalId });
github EnKrypt / Doppler / backend / src / app.ts View on Github external
const poll = async () => {
    cpuLoad = await SI.currentLoad();
    mem = await SI.mem();
    disk = await SI.fsSize();
    processes = await SI.processes();
    network = await SI.networkStats();
    try {
        cpuTemp = await SI.cpuTemperature();
        if (!cpuTemp.cores.length) {
            throw new Error('Cannot monitor CPU temperature');
        }
    } catch (e) {
        cpuTemp = {
            main: 0,
            cores: Array(cpu.cores).fill(0),
            max: 0
        };
        if (!tempFlag) {
            console.warn(
                'Cannot pull temperature data. On Linux, make sure `sensors` is available (package: lm-sensors). For OS X, install osx-temperature-sensor. Some CPUs are not supported on Windows.'
            );
            tempFlag = true;
        }
    }
github Swizec / thaw-carrots / index.js View on Github external
async function readTemp() {
    const temp = await si.cpuTemperature();
    return { main: temp.main, cores: temp.cores };
}
github sbuggay / sentry / packages / sentry-server-data / src / Server.ts View on Github external
export async function dynamicInfo(): Promise {
	const osData = {
		hostname: os.hostname(),
		uptime: os.uptime(),
		freemem: os.freemem(),
		totalmem: os.totalmem(),
		cpus: os.cpus(),
		loadavg: os.loadavg()
	}

	const promises = [
		si.battery(),
		si.graphics(),
		si.osInfo(),
		si.fsSize(),
		si.cpuTemperature()
	];

	const [battery, graphics, osInfo, fsSize, cpuTemp] = await Promise.all(promises);
	return {
		...osData,
		battery,
		graphics,
		osInfo,
		fsSize,
		cpuTemp
	};

}
github DeadPackets / HackPi / server / functions / fn.js View on Github external
si.cpuCurrentspeed(function(speed) {
		si.cpuTemperature(function(temp) {
			si.currentLoad(function(load) {
				SYSINFO.cpu = {
					speed,
					temp,
					load
				}
			})
		})
	})
}