Skip to content

Instantly share code, notes, and snippets.

@pfeilbr
Created October 20, 2014 15:17
Show Gist options
  • Save pfeilbr/f5a7a938a98ba62d1d52 to your computer and use it in GitHub Desktop.
Save pfeilbr/f5a7a938a98ba62d1d52 to your computer and use it in GitHub Desktop.
node OS module playground
var os = require('os');
var methodNames = [];
for (var prop in os) {
if ( os.hasOwnProperty(prop) && typeof os[prop] === 'function') {
methodNames.push(prop)
}
}
methodNames.forEach(function(methodName) {
var code = "os." + methodName + "()";
var result = eval(code);
console.log(code + " = " + JSON.stringify(result) );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment