Module file

file name - operator.js

const add = (a, b)=>{
return a +b ;
}
const sub = (a, b)=>{
return a - b ;
}

const name ='kanha';

module.exports = {add, sub , name};


index file - where you are importing the modules 

filename = index.js
const op = require('./operator');


console.log(op.add(2,5));

console.log(op.sub(2,5));

console.log(op.name);