In Node.js to include a JavaScript file in another JavaScript file, use module.exports as module is a variable that represents the current module and exports is an object that will be exposed as a module.
create a file named message.js and write the following code
module.exports = 'Hello world';
now create a file named app.js and type the below code
var msg = require('./Messages.js');
console.log(msg);
and when you run app.js you will be able to see this
C:\> node app.js
Hello World
So this how you inculde one JavaScript in another