npm.io
3.1.8 • Published 4 years ago

@tomsd/rand

Licence
MIT
Version
3.1.8
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
1

@tomsd/rand

functions returning random values

npm NPM npms.io (quality) Libraries.io dependency status for latest release Maintenance

Installation

npm install @tomsd/rand

Usage

import { Rand } from "@tomsd/rand";

console.log(Rand.char()); // one character that is between a and z

console.log(Rand.str()); // 5 character string

const length_wanted = 8;
console.log(rand.str(length_wanted).length); // 8

console.log(rand.id()); // random string

const prefix_str = "abc";
console.log(rand.id(prefix_str)); // prefixed