MCPcopy Create free account
hub / github.com/sindresorhus/random-int

github.com/sindresorhus/random-int @v3.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.1.0 ↗ · + Follow
2 symbols 10 edges 4 files 0 documented · 0% 4 cross-repo links updated 12mo agov3.1.0 · 2025-09-15★ 91

Browse by type

Functions 2 Types & classes 0
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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.

If minimum is greater than maximum, the values are swapped to return an integer from the lower value to the higher value.

minimum

Type: number\ Default: 0

Minimum integer to return.

maximum

Type: number\ Default: 1

Maximum integer to return.

Related

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 2

Languages

TypeScript100%

Modules by API surface

test.js1 symbols
index.js1 symbols

For agents

$ claude mcp add random-int \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page