guidesmiths/prepper

View on GitHub
lib/handlers/System.js

Summary

Maintainability
A
0 mins
Test Coverage
var EventEmitter = require('events').EventEmitter
var util = require('util')
var os = require('os')
var merge = require('lodash.merge')

function System() {

    var self = this

    this.handle = function(event) {
        self.emit('message', merge({}, { os: { hostname: os.hostname(), loadavg: os.loadavg(), mem: { total: os.totalmem(), free: os.freemem() }, type: os.type(), platform: os.platform(), release: os.release() }}, event))
    }

    EventEmitter.call(this);
}

util.inherits(System, EventEmitter)

module.exports = System