random-data-class

1.0.3 • Public • Published

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());

Package Sidebar

Install

npm i random-data-class

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

4.46 kB

Total Files

4

Last publish

Collaborators

  • gam3r-chg