math-wizard 1.0.0 → 1.0.2

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 ADDED
@@ -0,0 +1,64 @@
1
+ # math-wizard
2
+
3
+ `math-wizard` is a tiny TypeScript-based npm package for performing simple numeric addition. It is designed to be easy to install and use in modern ESM-compatible JavaScript and TypeScript projects.
4
+
5
+ ## Features
6
+
7
+ - Add two numbers with a single function
8
+ - TypeScript-friendly API with type declarations
9
+ - ESM-compatible package entry point
10
+ - Minimal dependency footprint
11
+ - Simple installation and usage
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install math-wizard
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```ts
22
+ import { add } from 'math-wizard';
23
+
24
+ const result = add(2, 3);
25
+ console.log(result); // 5
26
+ ```
27
+
28
+ ## Examples
29
+
30
+ ### Basic addition
31
+
32
+ ```ts
33
+ import { add } from 'math-wizard';
34
+
35
+ console.log(add(10, 15));
36
+ // Output: 25
37
+ ```
38
+
39
+ ### Using the function in a TypeScript file
40
+
41
+ ```ts
42
+ import { add } from 'math-wizard';
43
+
44
+ function sumValues(a: number, b: number) {
45
+ return add(a, b);
46
+ }
47
+
48
+ console.log(sumValues(4, 7));
49
+ // Output: 11
50
+ ```
51
+
52
+ ## API
53
+
54
+ ### `add(a, b)`
55
+
56
+ - `a`: number
57
+ - `b`: number
58
+ - returns: number
59
+
60
+ Adds two numeric values and returns the sum.
61
+
62
+ ## License
63
+
64
+ MIT
@@ -0,0 +1 @@
1
+ export declare const add: (a: number, b: number) => number;
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export const add = (a, b) => {
2
+ return a + b;
3
+ };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "math-wizard",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "a package that enables you to add numbers",
5
- "main": "index.js",
6
5
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
6
+ "build": "tsc",
7
+ "prepublish": "npm run build"
8
8
  },
9
9
  "keywords": [
10
10
  "add",
@@ -13,7 +13,19 @@
13
13
  ],
14
14
  "author": "Moe",
15
15
  "license": "MIT",
16
- "type": "commonjs",
16
+ "type": "module",
17
+ "main": "./dist/index.js",
18
+ "types": "./dist/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "import": "./dist/index.js",
22
+ "types": "./dist/index.d.ts"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "peerDependencies": {},
17
29
  "dependencies": {
18
30
  "typescript": "^6.0.2"
19
31
  }
package/index.ts DELETED
@@ -1,5 +0,0 @@
1
- function add(a: number, b: number) {
2
- return a + b;
3
- };
4
-
5
- export default add;