status
Version:
System automation on steroids
33 lines (29 loc) • 904 B
text/coffeescript
{exec} = require "child_process"
os = require "os"
{readableSpeed, calculateCPU} = require "fractal"
module.exports =
meta:
name: "cpu"
author: "Contra"
version: "0.0.1"
description: "CPU information"
temp: (format="raw") ->
# TODO: implement
usage: (format="raw") ->
cpus = os.cpus()
if format is "raw"
calc = (calculateCPU cpu.times for cpu in cpus)
else if format is "pretty"
calc = (calculateCPU cpu.times, true for cpu in cpus)
else
speed: (format="raw") ->
cpus = os.cpus()
if format is "raw"
calc = (cpu.speed for cpu in cpus)
else if format is "pretty"
calc = (readableSpeed cpu.speed for cpu in cpus)
else