If you want to load only exported objects from an external file, you can use the function require.
var imported = require('your-module');
If you want to execute an external Javascript file directly in your global scope (similar to PHP include), you should use eval.
eval(require('fs').readFileSync('your-module\\index.js') + '');
user6586783