I have a Node app. In this app, I have a directory structure like this:
library/
ents/
index.js
index.js
package.json
settings.json
My settings.json file looks like this:
settings.json
{
"url":"http://www.example.com"
}
There's more in the file, but that's not relevant to this question. In the ./library/ents/index.js file I have the following:
let settings = require('../../settings');
console.log(settings);
This executes. But, I was expecting to see the contents of the settings.json file printed out. Instead, I just see {}
. I really don't understand why this would happen.