@outbook/random-integer
v1.0.2
Published
Random integer function, with minimum and maximum values
Readme
@outbook/random‑integer
Import and use it:
// ES‑module syntax (recommended)
import { randomInteger } from '@arr2019/random-integer';
// Basic call – returns an integer in [0, 10) (10 is exclusive)
const n1 = randomInteger({ min: 0, max: 10 });
console.log(n1); // 0 … 9
// Inclusive upper bound
const n2 = randomInteger({ min: 0, max: 10, inclusive: true });
console.log(n2); // 0 … 10
// Rely on defaults (min = 0, max = 10, exclusive)
const n3 = randomInteger(); // same as randomInteger({})
console.log(n3);
