Solution:
rect.js
var rect={
area: function(l,b)
{
var a;
a=l*b;
console.log('area of rectangle is:'+a);
}
};
module.exports=rect
myrect.js
var mymod=require('C:/Users/Public/node_prog/rect.js');
mymod.area(5,4);
Initiate myrect.js file :
C:\Users\Your Name>node myrect.js
0 Comments