fastrand
v1.0.3
Published
FastRand provides the quickest and easiest random generated results.
Maintainers
Readme
What is this?
FastRand provides the quickest and easiest random generated results.
This package is random and generates random results quickly.🎲
Installation
npm install fastrand --save
Usage
const fastrand = require('fastrand');
// Generate a random integer
fastrand.int(maximum, minimum) // returns an integer between [ maximum, minimum ]
// Generate a random float
fastrand.float(maximum, minimum) // returns a float between [ maximum, minimum ]
// Generate boolean
fastrand.boolean() // returns [ true, false ]
// Higher lower
fastrand.chance(percentage) // returns [ true, false ] (Returns true if below or equals to percentage)int
Usage: fastrand.int(maximum, minimum)
Returns an integer between maximum and minimum.
maximuminteger (optional, default:1)minimuminteger (optional, default:0)
float
Usage: fastrand.float(maximum, minimum)
Returns a float between maximum and minimum.
maximumfloat (optional, default:1)minimumfloat (optional, default:0)
boolean
Usage: fastrand.boolean()
Returns true or false.
chance
Usage: fastrand.chance(percentage)
Returns true or false.
percentageinteger (optional, default:50)
rng
Usage: fastrand.rng(length)
Returns a number with a length of length.
lengthinteger (optional, default: 6, maximum: 15)
die
Usage: fastrand.die()
Rolls a die and returns the value.
