This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const spawn = require('child_process').spawn; | |
const cmd = "top -l1|grep usage|cut -d' ' -f3|tr -d '%'|tr -d '\n'"; | |
const child = shspawn(cmd); | |
let buf=""; | |
child.stdout.on('data',(data)=>{ | |
buf=buf+data; |