Currently I\'m doing this:
foo.js
const FOO = 5; module.exports = { FOO: FOO };
And using it in bar.js:<
bar.js
Since Node.js is using the CommonJS patterns, you can only share variables between modules with module.exports or by setting a global var like you would in the browser, but instead of using window you use global.your_var = value;.
module.exports
global.your_var = value;