You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,11 @@ npm install make-random
19
19
## Examples
20
20
### Jump-to:
21
21
-[random()](#random)
22
+
-[coinFlip()](#coinFlip)
22
23
-[randomInRange()](#randomInRange)
23
24
-[randomAZString()](#randomAZString)
24
25
-[randomString()](#randomString)
26
+
-[randomCaseString()](#randomCaseString)
25
27
-[randomLatin()](#randomLatin)
26
28
-[randomUUID()](#randomUUID)
27
29
@@ -54,6 +56,18 @@ random()
54
56
.then(resp=>console.log(resp))
55
57
```
56
58
59
+
### coinFlip()
60
+
61
+
The `coinFlip()` method accepts no arguments. The method returns a random boolean value.
62
+
63
+
```javascript
64
+
const { coinFlip } =require('make-random')
65
+
66
+
// Return a random boolean value
67
+
coinFlip()
68
+
.then(resp=>console.log(resp))
69
+
```
70
+
57
71
### randomInRange()
58
72
59
73
The `randomInRange()` method accepts any integers or integer-like strings as optional single or pair arguments. The method returns a true integer between the 2 arguments given. If only 1 argument is given, the random number will be between the argument value and 100. If no arguments are given, the method defaults to returning a random integer between -100 and 100. If the arguements are the same value (-10, "-10"), the method will return an integer between 0 and the passed arguments as if `random()` was used.
@@ -140,6 +154,26 @@ randomString('20')
140
154
.then(resp=>console.log(resp))
141
155
```
142
156
157
+
### randomCaseString()
158
+
159
+
The `randomCaseString()` method accepts an optional integer or integer-like argument. It returns an alpha-numeric randomly mixed-case string of the specified length. If no argument is given, method defaults to a 10 character string.
The `randomLatin()` method accepts an optional integer or integer-like argument. It returns a string with the specified number of random latin words. If no argument is given, method defaults to 5 words. All words start with E or R.
0 commit comments