kelvin-classwork-add 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 (3) hide show
  1. package/app.js +9 -0
  2. package/math.js +30 -0
  3. package/package.json +8 -0
package/app.js ADDED
@@ -0,0 +1,9 @@
1
+ const math = require('./math');
2
+
3
+ const sum = math.add(5, 5);
4
+ console.log(sum);
5
+ const product = math.multiply(5, 5);
6
+ console.log(product);
7
+ const difference = math.subtract(10, 5);
8
+ console.log(difference);
9
+
package/math.js ADDED
@@ -0,0 +1,30 @@
1
+ function add(a, b) {
2
+ return a + b;
3
+ }
4
+ module.exports = { add };
5
+
6
+ function multiply(a, b) {
7
+ return a * b;
8
+ }
9
+ module.exports = { multiply };
10
+
11
+ function subtract(a, b) {
12
+ return a - b;
13
+ }
14
+ module.exports = { subtract };
15
+
16
+ function divide(a, b) {
17
+ return a / b;
18
+ }
19
+ module.exports = { divide };
20
+
21
+ function modulus(a, b) {
22
+ return a % b;
23
+ }
24
+ module.exports = { modulus };
25
+
26
+ function power(a, b) {
27
+ return Math.pow(a, b);
28
+ }
29
+ module.exports = { power };
30
+
package/package.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "kelvin-classwork-add",
3
+ "version": "1.0.0",
4
+ "description": "JavaScript classwork project",
5
+ "main": "app.js",
6
+ "author": "Kelvin",
7
+ "license": "ISC"
8
+ }