math-wizard 1.0.1 → 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 +64 -0
- package/package.json +2 -2
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
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "math-wizard",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "a package that enables you to add numbers",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc",
|
|
7
|
-
"
|
|
7
|
+
"prepublish": "npm run build"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [
|
|
10
10
|
"add",
|