num-parity-core 1.1.0 โ†’ 1.1.3

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 (2) hide show
  1. package/README.md +102 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -0,0 +1,102 @@
1
+ # โšก num-parity-core
2
+
3
+ > A minimal, fast and reliable Node.js utility to detect number parity (even or odd).
4
+
5
+ ---
6
+
7
+ ## ๐Ÿš€ Why num-parity-core?
8
+
9
+ Because number validation should be instant, predictable, and dependency-free.
10
+
11
+ No frameworks. No noise. Just logic.
12
+
13
+ ---
14
+
15
+ ## ๐Ÿ“ฆ Installation
16
+
17
+ npm install num-parity-core
18
+
19
+ ---
20
+
21
+ ## ๐Ÿง  Usage
22
+
23
+ const { isEven, parity } = require("num-parity-core");
24
+
25
+ // Boolean check
26
+ console.log(isEven(10)); // true
27
+ console.log(isEven(7)); // false
28
+
29
+ // Human-readable result
30
+ console.log(parity(10)); // "even"
31
+ console.log(parity(7)); // "odd"
32
+
33
+ ---
34
+
35
+ ## โš™๏ธ API Reference
36
+
37
+ isEven(number)
38
+
39
+ Returns true if the number is even, otherwise false.
40
+
41
+ isEven(4); // true
42
+ isEven(9); // false
43
+ parity(number)
44
+
45
+ Returns a string representing the number parity:
46
+
47
+ "even"
48
+ "odd"
49
+ parity(2); // "even"
50
+ parity(3); // "odd"
51
+
52
+ ---
53
+
54
+ ## ๐Ÿงช Example
55
+ for (let i = 1; i <= 10; i++) {
56
+ console.log(i, "โ†’", parity(i));
57
+ }
58
+
59
+ Output:
60
+
61
+ 1 โ†’ odd
62
+ 2 โ†’ even
63
+ 3 โ†’ odd
64
+ 4 โ†’ even
65
+ 5 โ†’ odd
66
+ 6 โ†’ even
67
+ 7 โ†’ odd
68
+ 8 โ†’ even
69
+ 9 โ†’ odd
70
+ 10 โ†’ even
71
+
72
+ ---
73
+
74
+ ## โšก Features
75
+
76
+ โšก Ultra lightweight
77
+ ๐Ÿง  Zero dependencies
78
+ ๐Ÿš€ Fast execution
79
+ ๐Ÿ“ฆ Works in Node.js
80
+ ๐Ÿงฉ Simple and predictable API
81
+
82
+ ---
83
+
84
+ ## ๐Ÿ“Œ Roadmap
85
+ TypeScript support
86
+ ESM module support
87
+ CLI tool (npx num-parity-core)
88
+ Browser compatibility
89
+ Benchmark optimizations
90
+ ๐Ÿค Contributing
91
+
92
+ Pull requests are welcome.
93
+
94
+ Keep it simple. Keep it clean.
95
+
96
+ ---
97
+
98
+ ## ๐Ÿ“„ License
99
+
100
+ MIT โ€” use freely, build freely, improve freely.
101
+
102
+ ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "num-parity-core",
3
- "version": "1.1.0",
3
+ "version": "1.1.3",
4
4
  "description": "Simple package to check if a number is even or odd",
5
5
  "main": "index.js",
6
6
  "keywords": [