Class: Text

Text

new Text(opts)

Class for generate text data, i.e text, lorem ipsum and another.
Parameters:
Name Type Description
opts object Options
Properties
Name Type Attributes Default Description
locale string <optional>
en Current locale

Methods

alphabet(opts)

Get an alphabet for current locale.
Parameters:
Name Type Description
opts object Options
Properties
Name Type Attributes Default Description
letterCase string <optional>
uppercase

answer()

Get a random answer in current language.

color()

Get a random color

hexColor()

Generate a random hex color.

level()

Generate a random level of danger or something else.

quote()

Get a random quote.

sentence()

Get a random sentence from text.

swearWord()

Get a random swear word.

text(opts)

Generate the text.
Parameters:
Name Type Description
opts object Options
Properties
Name Type Attributes Default Description
quantity number <optional>
5 Quantity of sentences.

word()

Get a random word.

words(opts)

Get the random words.
Parameters:
Name Type Description
opts object Options
Properties
Name Type Attributes Default Description
quantity number <optional>
5 Quantity of words. Default is 5.