Skip to content

Instantly share code, notes, and snippets.

@BlackHole1
BlackHole1 / getCPU.js
Last active November 24, 2018 09:04
get cpu
const existsSync = require('fs').existsSync;
const execSync = require('child_process').execSync;
const isWin = process.platform === 'win32';
let winWmic = '';
const wmicFilePath = process.env.WINDIR + '\\system32\\wbem\\wmic.exe';
try {
const getWmic = (() => {
if (winWmic) return winWmic;