var os = require('os-utils');
os.cpuUsage(function(v){
v = Math.round(v*100);
console.log( `os-utils get CPU Usage : ${v}%`);
return v
});
var cpuUsage = os.cpuUsage(v());
console.log('what is that '+ cpuUsage); console.log(v); // undefined
I want to put the value in a variable and declare it as a global variable. I can't understand the asynchronous way. Please help me how to set up the callback function