diff --git a/nodejs/main.js b/nodejs/main.js new file mode 100644 index 00000000..299490c3 --- /dev/null +++ b/nodejs/main.js @@ -0,0 +1,7 @@ +let m = require('./math-tools'); + +console.log(m.PI); +console.log(m.add(1,2)); +console.log(m.subtract(1,2)); +console.log(m.multiply(1,2)); +console.log(m.divide(1,2)); \ No newline at end of file diff --git a/nodejs/math-tools.js b/nodejs/math-tools.js new file mode 100644 index 00000000..2fd2305f --- /dev/null +++ b/nodejs/math-tools.js @@ -0,0 +1,9 @@ +let calculator = { + PI : 3.14, + add : (a, b) => a + b, + subtract : (a, b) => a - b, + multiply : (a, b) => a * b, + divide : (a, b) => a / b +} + +module.exports = calculator; \ No newline at end of file diff --git a/nodejs/test.js b/nodejs/test.js new file mode 100644 index 00000000..125fcd0d --- /dev/null +++ b/nodejs/test.js @@ -0,0 +1 @@ +console.log('Hello Node.js') \ No newline at end of file