node-random-number

0.1.1 • Public • Published

node-random-number NPM version NPM downloads Build Status testen badge

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

Readme

Keywords

Package Sidebar

Install

npm i node-random-number

Weekly Downloads

54

Version

0.1.1

License

MIT

Last publish

Collaborators

  • kchan