math-labs 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.
package/Readme.md ADDED
@@ -0,0 +1,9 @@
1
+ # sam-math-utils
2
+
3
+ Simple math utility functions.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install math-labs
9
+ ```
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ const MathUtils = require("./src/math");
2
+
3
+ module.exports = new MathUtils();
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "math-labs",
3
+ "version": "1.0.0",
4
+ "description": "Simple math utility package",
5
+ "main": "index.js",
6
+ "keywords": [
7
+ "math",
8
+ "utils",
9
+ "calculator"
10
+ ],
11
+ "author": "Your Name",
12
+ "license": "MIT"
13
+ }
package/src/math.js ADDED
@@ -0,0 +1,22 @@
1
+ class MathUtils {
2
+ add(a, b) {
3
+ return a + b;
4
+ }
5
+
6
+ subtract(a, b) {
7
+ return a - b;
8
+ }
9
+
10
+ multiply(a, b) {
11
+ return a * b;
12
+ }
13
+
14
+ divide(a, b) {
15
+ if (b === 0) {
16
+ throw new Error("Cannot divide by zero");
17
+ }
18
+ return a / b;
19
+ }
20
+ }
21
+
22
+ module.exports = MathUtils;