require will get file
exports will help file to be used in require file
example
main.js
var mymodule = require('./mymodule.js');
console.log('asdfasdf ' + mymodule.hello());
mymodule.js
exports.hello = function(){
return 'hello 2';
}
No comments:
Post a Comment