random-data-class
v1.0.3
Published
Generate random content (int, char, word, sentence)
Downloads
11
Maintainers
Readme
Generate random content (int, char, word, sentence)
Install:
npm i random-data-class
Usage:
import RandomData from "random-data-class";
const rnd = new RandomData();
Get random char in specified language
- @param language Language of char (english, russian) Default - english.
console.log(rnd.getRandomChar());
Get word in specified language
- @param minlengthOfWord min letters
- @param maxLengthOfWord max letters
- @param language Language of word (english, russian) Default - english.
console.log(rnd.getRandomWord(4, 8));
Get random sentence
- @param minNumberOfWords = 1,
- @param maxNumberOfWords = 5,
- @param language = "english")
console.log(rnd.getRandomSentence());
Get random int number (min and max inclusive)
- If only 1 argument - then this is max.
- If no arguments then min=0, max=10
- @param min minimum or maximum number (not required)
- @param max maximum number (not required)
- @returns {number} Random int from min to max inclusive
console.log(rnd.getRandomInt());