just-random-integer
TypeScript icon, indicating that this package has built-in type declarations

4.2.0 • Public • Published

just-random-integer

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-random-integer
yarn add just-random-integer

Produces a random integer within a given range

import random from 'just-random-integer';

random();
// Returns either 0 or 1
random(5);
// Returns a random integer between 0 and 5 (inclusively)
random(3, 10);
// Returns a random integer between 3 and 10 (inclusively)
random(-5.8, 10.4);
// Returns a random integer between -5 and 10 (inclusively)

Readme

Keywords

Package Sidebar

Install

npm i just-random-integer

Weekly Downloads

125

Version

4.2.0

License

MIT

Unpacked Size

4.68 kB

Total Files

9

Last publish

Collaborators

  • angus-c