I am learning nodejs , I find two way to exports our function in Nodejs , but I can not find what is difference between in those The first is
module.exports.UserService = (function () {
return {
getUser:getUser
}
})()
And another
var getUser=function(searchInfo,res){}
module.exports.getUser=getUser
Is there any disadvantage or advantage of using , or any other best practice for exports function