num-parity-core 1.1.1 โ 1.1.4
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 +24 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,10 +14,12 @@ No frameworks. No noise. Just logic.
|
|
|
14
14
|
|
|
15
15
|
## ๐ฆ Installation
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
npm install num-parity-core
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## ๐ง Usage
|
|
19
22
|
|
|
20
|
-
๐ง **Usage**
|
|
21
23
|
const { isEven, parity } = require("num-parity-core");
|
|
22
24
|
|
|
23
25
|
// Boolean check
|
|
@@ -28,7 +30,10 @@ console.log(isEven(7)); // false
|
|
|
28
30
|
console.log(parity(10)); // "even"
|
|
29
31
|
console.log(parity(7)); // "odd"
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## โ๏ธ API Reference
|
|
36
|
+
|
|
32
37
|
isEven(number)
|
|
33
38
|
|
|
34
39
|
Returns true if the number is even, otherwise false.
|
|
@@ -44,7 +49,9 @@ Returns a string representing the number parity:
|
|
|
44
49
|
parity(2); // "even"
|
|
45
50
|
parity(3); // "odd"
|
|
46
51
|
|
|
47
|
-
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## ๐งช Example
|
|
48
55
|
for (let i = 1; i <= 10; i++) {
|
|
49
56
|
console.log(i, "โ", parity(i));
|
|
50
57
|
}
|
|
@@ -62,7 +69,9 @@ Output:
|
|
|
62
69
|
9 โ odd
|
|
63
70
|
10 โ even
|
|
64
71
|
|
|
65
|
-
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## โก Features
|
|
66
75
|
|
|
67
76
|
โก Ultra lightweight
|
|
68
77
|
๐ง Zero dependencies
|
|
@@ -70,7 +79,9 @@ Output:
|
|
|
70
79
|
๐ฆ Works in Node.js
|
|
71
80
|
๐งฉ Simple and predictable API
|
|
72
81
|
|
|
73
|
-
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## ๐ Roadmap
|
|
74
85
|
TypeScript support
|
|
75
86
|
ESM module support
|
|
76
87
|
CLI tool (npx num-parity-core)
|
|
@@ -82,6 +93,10 @@ Pull requests are welcome.
|
|
|
82
93
|
|
|
83
94
|
Keep it simple. Keep it clean.
|
|
84
95
|
|
|
85
|
-
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## ๐ License
|
|
99
|
+
|
|
100
|
+
MIT โ use freely, build freely, improve freely.
|
|
86
101
|
|
|
87
|
-
|
|
102
|
+
---
|