harshitraj 0.0.0-stage → 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 (4) hide show
  1. package/README.md +27 -2
  2. package/index.js +26 -0
  3. package/package.json +11 -4
  4. package/test.js +7 -0
package/README.md CHANGED
@@ -1,3 +1,28 @@
1
- # Temporary Holding Version
2
1
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
2
+ # harshitraj
3
+
4
+ A simple mathematical utility package.
5
+
6
+ ## Installation
7
+
8
+ npm install harshitraj
9
+
10
+ ## Usage
11
+
12
+ const math = require("harshitraj");
13
+
14
+ console.log(math.add(10, 5));
15
+ console.log(math.subtract(10, 5));
16
+ console.log(math.multiply(10, 5));
17
+ console.log(math.divide(10, 5));
18
+
19
+ ## Functions
20
+
21
+ - add(a, b)
22
+ - subtract(a, b)
23
+ - multiply(a, b)
24
+ - divide(a, b)
25
+
26
+ ## Author
27
+
28
+ Harshit
package/index.js ADDED
@@ -0,0 +1,26 @@
1
+
2
+ function add(a, b) {
3
+ return a + b;
4
+ }
5
+
6
+ function subtract(a, b) {
7
+ return a - b;
8
+ }
9
+
10
+ function multiply(a, b) {
11
+ return a * b;
12
+ }
13
+
14
+ function divide(a, b) {
15
+ if (b === 0) {
16
+ throw new Error("Cannot divide by zero");
17
+ }
18
+ return a / b;
19
+ }
20
+
21
+ module.exports = {
22
+ add,
23
+ subtract,
24
+ multiply,
25
+ divide
26
+ };
package/package.json CHANGED
@@ -1,6 +1,13 @@
1
+
1
2
  {
2
3
  "name": "harshitraj",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
4
+ "version": "1.0.0",
5
+ "description": "A simple mathematical utility npm package",
6
+ "main": "index.js",
7
+ "scripts": {
8
+ "test": "node test.js"
9
+ },
10
+ "keywords": ["math", "calculator", "utility"],
11
+ "author": "Harshit",
12
+ "license": "MIT"
13
+ }
package/test.js ADDED
@@ -0,0 +1,7 @@
1
+
2
+ const math = require("./index");
3
+
4
+ console.log("Addition:", math.add(10, 5));
5
+ console.log("Subtraction:", math.subtract(10, 5));
6
+ console.log("Multiplication:", math.multiply(10, 5));
7
+ console.log("Division:", math.divide(10, 5));