rajathcalc 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +31 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Custom calculator module for Node.js.
3
+ */
4
+
5
+ // Logs sum of two numbers
6
+ function addition(a, b) {
7
+ console.log(a + b);
8
+ }
9
+
10
+ // Logs difference of two numbers
11
+ function subtraction(a, b) {
12
+ console.log(a - b);
13
+ }
14
+
15
+ // Logs product of two numbers
16
+ function multiplication(a, b) {
17
+ console.log(a * b);
18
+ }
19
+
20
+ // Logs quotient of two numbers
21
+ function division(a, b) {
22
+ console.log(a / b);
23
+ }
24
+
25
+ // Export functions for use in other modules
26
+ module.exports = {
27
+ addition,
28
+ subtraction,
29
+ multiplication,
30
+ division
31
+ };
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "rajathcalc",
3
+ "version": "1.0.0",
4
+ "description": "This is a calculator modul;e developed during node course by scaler topics",
5
+ "license": "ISC",
6
+ "author": "Rajath kiran A",
7
+ "type": "commonjs",
8
+ "main": "index.js",
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ }
12
+ }