@qwertyr0/ezrandom

2.1.0 • Public • Published

ezrandom

ezrandom is a simple pseudo random number generator library.

node

📦Installation

npm i @qwertyr0/ezrandom
# or:
npm i git+https://github.com/QwertyR0/ezrandom.git

👩‍💻USAGE:

import ezRandom from "@qwertyr0/ezrandom";

//random numbers:
ezRandom.genInt(1, 3);
//-> 1

ezRandom.genInt(1, 3, 4);
//-> [1, 3, 2, 3]

ezRandom.genFloat(1, 3);
//-> 2.345

// random selection:
ezRandom.selection(["a", "b"], 1);
//-> ["a"]

// probability:
ezRandom.probability(1, 10, 3, 4);
//-> 1.39

// random password:
ezRandom.password({
    passLength: 11
});
//-> naxohnjykom

// Array shuffle:
ezRandom.shuffle([12, 53, 44, 23]);
//-> [44, 12, 23, 53]

// random rgb color value:
ezRandom.ranColor.rgb();
//-> [52, 7, 109]

// random hex color value:
ezRandom.ranColor.hex();
//-> "#a97b30"

/*
 There are more options that are not shown here
 but it's documented with jsdoc in "main.js"
*/

👔Maintainer

QwertyR0

QwertyR0


🐛Bugs:

Create an issue here

LICENSE: MIT

Package Sidebar

Install

npm i @qwertyr0/ezrandom

Weekly Downloads

5

Version

2.1.0

License

MIT

Unpacked Size

9.59 kB

Total Files

4

Last publish

Collaborators

  • qwertyr0