node-random-number
Generate one or more random unique numbers in a range.
Last updated 5 years ago by kchan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install node-random-number 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.1                                ...           latest (5 years ago)

2 Versions

  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (2)
Dependents (4)

Copyright 2014 - 2017 © taobao.org |