Created
February 17, 2011 17:54
-
-
Save bmavity/832248 to your computer and use it in GitHub Desktop.
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
// readFile.js | |
// Load the built in file system module | |
var fs = require('fs'); | |
// Read the config file (sychronously) | |
var rawConfig = fs.readFileSync(__dirname + '/config.json', 'utf8'); | |
// Convert the file contents to JSON | |
var config = JSON.parse(rawConfig); | |
console.log(config.user); // brian |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment