I'll start of with saying I'm new to NodeJS but i've been developing in PHP for a number of years (doesn't mean much I know).
I started tinkering with Node recently and discovered something strange I hope someone can help with
I have a file call
var fs = require('fs')
var settings = fs.readFileSync('./config/settings.json', 'utf8')
var settings = require('./config/settings.json')
fs.readFileSync() just reads the data contained in the file, but it doesn't parse it.
For that, you need an additional step:
var settings = JSON.parse( fs.readFileSync('./config/settings.json', 'utf8') );
require() will parse the data automatically.