node-random-number
v0.1.1
Published
Generate one or more random unique numbers in a range.
Downloads
334
Readme
node-random-number
Generate one or more random unique numbers in a range.
Install
$ npm install --save node-random-number
Usage
const random = require('node-random-number')
// get a random integer between 0 ~ 100 (100 in not includede)
random()
//=> [58]
random({start: 3, end: 9})
//=> [7]
random({count: 3})
//=> [2, 37, 87]
API
nodeRandomNumber(opts)
opts
start
Type: number
Default: 0
The start of the range, included.
end
Type: number
Default: 100
The end of the range, not included.
count
Type: number
Default: 1
How many numbers you wanna get, should be smaller than the range length.
License
MIT © EGOIST