a small set of shared js utility functions, with no dependencies.
yarn add uvk
const uvk = require('uvk);
uvk.range(5).map(_ => console.log("this will be executed 5 times"));
uvk.randomizer.dice(); // this will roll a 6 faced dice
A set of function to work with randomness
Get a random element from an array
const randomizer = require('uvk').randomizer;
randomizer.pickOne([1,2,3]); // > 2
Get a random integer number, between low and high
const randomizer = require('uvk').randomizer;
const LOW = 2;
const HIGH = 8;
randomizer.int(LOW, HIGH); // > 4
Get a boolean related to a chance in percentage
const randomizer = require('uvk').randomizer;
randomizer.chance(90); // > 90% of the times this will be true
Roll a dice of X number of faces (6 by default)
const randomizer = require('uvk').randomizer;
randomizer.dice(); // > 4
Set of small text and number utils that I use between projects
Set of Consts