I am having issues including files to execute in my NodeJs project.
I have two files in the same directory:
a.js
var test = \"He
if you want to export the variable in another file.There are two patterns.
One is
a.js
global.test = "Hello World";
//test here is global variable,but it will be polluted
The other is
a.js
module.exports.test = "Hello World";
or exports.test= "Hello World";
b.js
var test = require('./a.js');
//test in b.js can get the test in a.js
console.log(test);