Created
October 20, 2014 15:17
-
-
Save pfeilbr/f5a7a938a98ba62d1d52 to your computer and use it in GitHub Desktop.
node OS module playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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