random-int
Generate a random integer
Last updated 5 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install random-int 
SYNC missed versions from official npm registry.

random-int

Generate a random integer

Install

$ npm install random-int

Usage

import randomInteger from 'random-int';

randomInteger(5);
//=> 3

randomInteger(10, 100);
//=> 54

API

randomInteger(maximum?)

Returns an integer from 0 to maximum.

randomInteger(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

Current Tags

  • 3.0.0                                ...           latest (4 years ago)

4 Versions

  • 3.0.0                                ...           4 years ago
  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (5)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE