Assuming this is a * nix server, you can use the uptime shell uptime using child_process :
var child = require('child_process'); child.exec('uptime', function (error, stdout, stderr) { console.log(stdout); });
If you want to format this value differently or pass it through to another location, this should be trivial for this.
EDIT: Determining uptime seems a bit unclear. This decision will tell the user how long the device has been turned on, which may or may not be what you are after.
source share