random-int alternatives and similar modules
Based on the "Number" category.
Alternatively, view random-int alternatives based on common mentions on social networks and blogs.
SaaSHub - Software Alternatives and Reviews
Do you think we are missing an alternative of random-int or a related project?
README
random-int
Generate a random integer
Install
$ npm install random-int
Usage
const randomInt = require('random-int');
randomInt(5);
//=> 3
randomInt(10, 100);
//=> 54
API
randomInt([maximum])
Returns an integer from 0
to maximum
.
randomInt(minimum, maximum)
Returns an integer from minimum
to maximum
.
minimum
Type: number
Default: 0
Minimum integer to return.
maximum
Type: number
Default: 1
Maximum integer to return.
Related
- random-float - Generate a random float
- random-item - Get a random item from an array
- random-obj-key - Get a random key from an object
- random-obj-prop - Get a random property 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
License
MIT © Sindre Sorhus
*Note that all licence references and agreements mentioned in the random-int README section above
are relevant to that project's source code only.