I have the following code in test1.js
.
module.exports = function(d){
d.demo1 = function() {
return "DEMO 1";
},
d.demo2 = function() {
return "DEMO 2";
}
}
I am trying to access function demo1 on test2.js
.
Below the code which call the function.
var demo = require('./test1');
var result = demo.****; //code to call function demo1
console.log("calling function", result); //output should be "calling function DEMO 1"
Please help how can I access this function. Thanks.