I\'m getting the error while running the following code in Node.js
var assert = require(\'assert\');
var request = require(\'request\');
var index = require(\'./
If you need to expose a specific component, function or a variable to public. You have to exports
those components using JavaScript modules.
let add = (a,b)=>{
return ( a+b);
}
module.exports.add=add;
or if you want to expose multiple functions, you can do as follows.
let add = (a,b)=>{
return (a+b);
}
let subtract = (a, b)=>{
return (a-b);
}
module.exports={
add : add,
subtract : subtract
};