randomiz
v1.3.3
Published
A npm library making randomness easier
Downloads
229
Maintainers
Readme
Randomiz - Randomness is easy now!
A lightweight JavaScript utility library for generating random numbers, selecting random elements, and shuffling arrays. This module provides commonly used randomization utilities to simplify your code.
Introduction
randomiz
includes utility functions for:
- Generating with flexibility random strings/arrays/numbers.
- Random stuff on arrays/strings.
Feel free to report any issues or fork on Github: https://github.com/manerr/randomiz
Full doc: documentation.md
Features
Simple and lightweight: Minimal code, no dependencies. [No more features, what were you waiting from a ranomness library?]
randFloor(a,b)
,randInt(a,b)
,randBytes(n)
,randBits(n)
,randToken(n)
→ get random numbers/arrays/stringsshuffle(l)
,choice(l,count)
,pick(l)
,pickPop(l)
→ random tools on arrays (strings are converted to 1-char arrays)
These functions are useful for game development, data sampling, and other scenarios requiring randomness.
Installation
Add the library to your project by copying the code or using a package manager (like npm :3 ) -> npm -i randomiz
( just use randomiz = require('randomiz')
or import randomiz from 'randomiz'
ad for any other npm package ;) )