Lorem
Module to generate random texts and words.
Overview
Generate dummy content using traditional faux-Latin lorem ipsum (in other locales to en, alternative words may be used).
In order of increasing size you can generate a single {{$lorem.word}}
, multiple {{$lorem.words}}
, a {{$lorem.sentence}}
, multiple {{$lorem.sentences}}
, {{$lorem.lines}}
separated by newlines, one {{$lorem.paragraph}}
, or multiple {{$lorem.paragraphs}}
.
The generic {{$lorem.text}}
method can be used to generate some text between one sentence and multiple paragraphs, while {{$lorem.slug}}
generates an URL-friendly hyphenated string.
lines
Generates the given number lines of lorem separated by '\n'
.
Parameters
Name | Type | Default | Description |
---|---|---|---|
max | number | The maximum number of lines to generate. | |
min | number | The minimum number of lines to generate. |
Returns: string
Examples
{{$lorem.lines}} // 'Aspernatur utor adopto.
Vis depulso illo corpus aetas vis.
Articulus pecto quia subito tandem deserunt assentator.'
{{$lorem.lines(min=1,max=3)}} // 'Amo cattus non.'
paragraph
Generates a paragraph with the given number of sentences.
Parameters
Name | Type | Default | Description |
---|---|---|---|
max | number | The maximum number of sentences to generate. | |
min | number | The minimum number of sentences to generate. |
Returns: string
Examples
{{$lorem.paragraph}} // 'Vergo tertius ancilla provident accendo adopto aequus deinde. Cur numquam fugiat armarium adopto verumtamen comminor cupressus creber. Adeptio decumbo demens adhuc quia.'
{{$lorem.paragraph(min=1,max=3)}} // 'Totus adfectus mollitia mollitia timor torrens vestrum aeger artificiose ultio. Colo correptius comprehendo excepturi vilitas sumo stabilis soleo.'
paragraphs
Generates the given number of paragraphs.
Parameters
Name | Type | Default | Description |
---|---|---|---|
max | number | The maximum number of paragraphs to generate. | |
min | number | The minimum number of paragraphs to generate. | |
separator | string | '\n' | The separator to use. |
Returns: string
Examples
{{$lorem.paragraphs}}
// 'Curtus defendo custodia caries tristis antea labore acquiro consequatur dolore. Timidus deleo desidero aperiam aetas solio cometes. Summopere ver adipisci celo atrocitas cupressus cunabula currus vinco.
Decet atavus torqueo caecus pecco vesica optio. Administratio ratione argentum paulatim artificiose. Cruentus certus vestrum eius abutor.'
{{$lorem.paragraphs(min=1,max=3)}} // 'Cauda depopulo esse creator. Acquiro vulgaris addo colo cumque vigilo. Degenero viridis cimentarius casus averto.'
sentence
Generates a space separated list of words beginning with a capital letter and ending with a period.
Parameters
Name | Type | Default | Description |
---|---|---|---|
max | number | The maximum number of words to generate. | |
min | number | The minimum number of words to generate. |
Returns: string
Examples
{{$lorem.sentence}}
// 'Distinctio aegrotatio votum cubitum repellendus sollers abduco.'
{{$lorem.sentence(min=1,max=3)}} // 'Tendo valeo infit.'
sentences
Generates the given number of sentences.
Parameters
Name | Type | Default | Description |
---|---|---|---|
max | number | The maximum number of sentences to generate. | |
min | number | The minimum number of sentences to generate. | |
separator | string | '\n' | The separator to add between sentences. |
Returns: string
Examples
{{$lorem.sentences}}
// 'Cena tener utor creator. Pecco crebro volo sui vos suscipio carmen terreo. Vado vobis calco conculco. Soluta vigilo acidus pax uter dignissimos. Administratio vorax cum sunt aegrus vetus.'
{{$lorem.sentences(min=1,max=3)}} // 'Trado unde patior thesis abundans hic barba arcesso vaco. Aureus antepono succedo dolorem. Aqua utroque tabernus antiquus quo talis vorago tepidus.'
slug
Generates a slugified text consisting of the given number of hyphen separated words.
Parameters
Name | Type | Default | Description |
---|---|---|---|
max | number | The maximum number of words to generate. | |
min | number | The minimum number of words to generate. |
Returns: string
Examples
{{$lorem.slug}} // 'valde-contigo-teres'
{{$lorem.slug(min=1,max=3)}} // 'accendo'
text
Generates a random text based on a random lorem method.
Returns: string
Examples
{{$lorem.text}} // 'Vulariter candidus repudiandae aliquid.
Fugiat theatrum vivo tolero desino thermae conforto voluptate sono.
Uterque voluntarius utilis vociferor verecundia talio decens constans surculus.
Tactus cohibeo abutor patruus amissio utor odit culpo capillus adstringo.'
word
Generates a word of a specified length.
Parameters
Name | Type | Default | Description |
---|---|---|---|
length | number | { min: number; max: number; } | 1 | The expected length of the word. |
max | number | The maximum number of word to generate. | |
min | number | The minimum number of word to generate. | |
strategy | 'fail' | 'closest' | 'shortest' | 'longest' | 'any-length' | 'any-length' | The strategy to apply when no words with a matching length are found. Available error handling strategies:- fail \: Throws an error if no words with the given length are found.- shortest \: Returns any of the shortest words.- closest \: Returns any of the words closest to the given length.- longest \: Returns any of the longest words.- any-length \: Returns a word with any length. |
Returns: string
Examples
{{$lorem.word}} // 'concido'
{{$lorem.word(strategy='shortest')}} // 'a'
{{$lorem.word(min=5,max=7,strategy='shortest')}} // 'auctus'
{{$lorem.word(length=2)}} // 'ab'
words
Generates a space separated list of words.
Parameters
Name | Type | Default | Description |
---|---|---|---|
max | number | The maximum number of words to generate. | |
min | number | The minimum number of words to generate. |
Returns: string
Examples
{{$lorem.words}} // 'truculenter vapulus cuius'
{{$lorem.words(min=1,max=3)}} // 'aggredior tracto dedico'