Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

readme.md

random-int Build Status

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

License

MIT © Sindre Sorhus

You can’t perform that action at this time.