1.0.2 • Published 9 months ago

bias-random v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

bias-random

npm npm npm

Generates biased random numbers with a customizable bias level, direction, and range

📦 Installation

npm i bias-random

# or
yarn add install bias-random

# or
pnpm i bias-random

🚀 Usage

import biasedRandom from "bias-random";

// Default settings:
// -Bias towards lower numbers
// -Bias level of 2
// -Range 0 to 1
// Average resulting value will be 1/3
const defaultResult = biasedRandom();

// Cutomize the parmeters (all parameters are optional, defaulting to the values above)
const customResult = biasedRandom({ upperBias: true, biasLevel: 4, min: 10, max: 1000 });