JSPM

@qwertyr0/ezrandom

2.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q16865F
  • License MIT

Makes Random Number Generation Easier

Package Exports

  • @qwertyr0/ezrandom
  • @qwertyr0/ezrandom/main.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@qwertyr0/ezrandom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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