UNPKG

nodejs_training

Version:

Demo of nodejs

19 lines (15 loc) 637 B
var ourModule = require('./secondExample'); //any module that needs to be used by js shouldbe prefixed with ./ except for std/core modules of node.js //loads the library into your reference console.log("developed by: " + ourModule.DevelopedBy) var sapList = ourModule.Employees; console.log(sapList.GetAllEmployees()); require('./usingGlobalModule'); console.log(add(123,234)); console.log(sub(120,4)); var math = require('./usingAnonymousModule')(); console.log(math.add(123,234)); console.log(math.sub(120,4)); var math1 = require('./usingNamedModule').MathProgram(); console.log(math1.add(123,234)); console.log(math1.sub(120,4));