random-int

3.0.0last stable release 4 years ago
Complexity Score
Low
Open Issues
1
Dependent Projects
114
Weekly Downloadsglobal
251,298

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

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.

minimum

Type: number
Default: 0

Minimum integer to return.

maximum

Type: number
Default: 1

Maximum integer to return.

Related

  • random-float - Generate a random float
  • random-item - Get a random item from an array
  • random-obj-key - Get a random key from an object
  • random-obj-prop - Get a random property from an object
  • unique-random - Generate random numbers that are consecutively unique
  • unique-random-array - Get consecutively unique elements from an array
  • crypto-random-string - Generate a cryptographically strong random string

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
3.60
Test Coverage
No Data
Follows Semver
Yes
Github Stars
86
Dependenciestotal
5
DependenciesOutdated
4
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute random-int in your own private NPM registry

npm config set registry  https://npm.cloudsmith.com/owner/repo
Processing...
Done
npm install random-int
Processing...
Done

4 Releases

NPM on Cloudsmith

Getting started with NPM on Cloudsmith is fast and easy.