Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

exports in node js

require function returns exports of the require module.
module.exports is the returned object.
1)use module.exports to export single varibale e.g one class or one function 
e.g module.exports= Calculator.
2)use exports to export multiple named variables 
export.add = (a,b)=> a+b;
export.multiple=(a,b)=> a*b;
 
PREVIOUS NEXT
Tagged: #exports #node #js
ADD COMMENT
Topic
Name
2+8 =