Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork16
sindresorhus/random-int
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Generate a random integer
npm install random-int
importrandomIntegerfrom'random-int';randomInteger(5);//=> 3randomInteger(10,100);//=> 54
Returns an integer from0 tomaximum.
Returns an integer fromminimum tomaximum.
Ifminimum is greater thanmaximum, the values are swapped to return an integer from the lower value to the higher value.
Type:number
Default:0
Minimum integer to return.
Type:number
Default:1
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
About
Generate a random integer
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.