in my app I share config variables this way:
const config = require('./config')
and config.js is a separate file:
module.exports = {
option1: value1,
option2: value2
};
If I change attributes in config object dynamically,
does it affect other modules as well?
for example:
config.js
module.exports = { foo: 'bar' }
app1.js
var config = require('./config');
module.exports.sayFoo = function () {
console.log(config.foo);
}
app2.js
var config = require('./config');
var app1 = require('./app1');
config.foo = 'baz';
app1.sayFoo();
# node app2.js =====> ??