Generate a random integer
npm install random-int> Generate a random integer
``sh`
npm install random-int
`js
import randomInteger from 'random-int';
randomInteger(5);
//=> 3
randomInteger(10, 100);
//=> 54
`
Returns an integer from 0 to maximum.
Returns an integer from minimum to maximum.
If minimum is greater than maximum, the values are swapped to return an integer from the lower value to the higher value.
#### minimum
Type: number\0
Default:
Minimum integer to return.
#### maximum
Type: number\1`
Default:
Maximum integer to return.
- random-float - Generate a random float
- random-item - Get a random item from an array
- random-object-key - Get a random key from an object
- random-object-value - Get a random value from an object
- unique-random - Generate random numbers that are consecutively unique
- unique-random-array - Get consecutively unique elements from an array
- crypto-random-string - Generate a cryptographically strong random string