1.0.0 • Published 5 years ago

redi-os v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

System Load

the simple way to stay informed with your system

Install via NPM:

npm i redi-os --save

Only tested on Raspberry Pi Zero W on NodeJS Version v10.14.2

API

Configuration
nametypedefaultdescription
timerint1check interval in seconds
Events
namedescriptionresponse
initinitials the timer
cpugets your current cpu load%
ramgets your current ram{ total: 'XXX MB', free: 'XXX MB', used: 'XXX MB', calc_free: 'XXX%', calc_used: 'XXX%' }
loadgets your current disk loadX,Y,Z
tickresponse on every timer tick{ cpu: XXX, ram: { total: 'XXX MB', free: 'XXX MB', used: 'XXX MB', calc_free: 'XXX%', calc_used: 'XXX%' }, load: X,Y,Z }
changeresponse if cpu,ram or load has changed{ cpu: XXX, ram: { total: 'XXX MB', free: 'XXX MB', used: 'XXX MB', calc_free: 'XXX%', calc_used: 'XXX%' }, load: X,Y,Z }

Full example as in example.js

const os = require('redi-os')
os.cpu( data => { console.log("cpu",data) })
os.ram( data => { console.log("ram",data) })
os.load( data => { console.log("load",data) })
os.tick( data => { console.log("tick",data) })
os.change( data => { console.log("change",data) })
os.init({timer:1})
1.0.0

5 years ago