Generates the given number lines of lorem separated by '\n'
.
Optional
lineCount: number | { max: number; min: number }The number of lines to generate. Defaults to a random number between 1
and 5
.
The maximum number of lines to generate.
The minimum number of lines to generate.
faker.lorem.lines()
// 'Rerum quia aliquam pariatur explicabo sint minima eos.
// Voluptatem repellat consequatur deleniti qui quibusdam harum cumque.
// Enim eveniet a qui.
// Consectetur velit eligendi animi nostrum veritatis.'
faker.lorem.lines()
// 'Soluta deserunt eos quam reiciendis libero autem enim nam ut.
// Voluptate aut aut.'
faker.lorem.lines(2)
// 'Quod quas nam quis impedit aut consequuntur.
// Animi dolores aspernatur.'
faker.lorem.lines({ min: 1, max: 3 })
// 'Error dolorem natus quos eum consequatur necessitatibus.'
Generates a paragraph with the given number of sentences.
Optional
sentenceCount: number | { max: number; min: number }The number of sentences to generate. Defaults to 3
.
The maximum number of sentences to generate.
The minimum number of sentences to generate.
faker.lorem.paragraph() // 'Non architecto nam unde sint. Ex tenetur dolor facere optio aut consequatur. Ea laudantium reiciendis repellendus.'
faker.lorem.paragraph(2) // 'Animi possimus nemo consequuntur ut ea et tempore unde qui. Quis corporis esse occaecati.'
faker.lorem.paragraph({ min: 1, max: 3 }) // 'Quis doloribus necessitatibus sint. Rerum accusamus impedit corporis porro.'
Generates the given number of paragraphs.
Optional
paragraphCount: number | { max: number; min: number }The number of paragraphs to generate. Defaults to 3
.
The maximum number of paragraphs to generate.
The minimum number of paragraphs to generate.
Optional
separator: stringThe separator to use. Defaults to '\n'
.
faker.lorem.paragraphs()
// 'Beatae voluptatem dicta et assumenda fugit eaque quidem consequatur. Fuga unde provident. Id reprehenderit soluta facilis est laborum laborum. Illum aut non ut. Est nulla rem ipsa.
// Voluptatibus quo pariatur est. Temporibus deleniti occaecati pariatur nemo est molestias voluptas. Doloribus commodi et et exercitationem vel et. Omnis inventore cum aut amet.
// Sapiente deleniti et. Ducimus maiores eum. Rem dolorem itaque aliquam.'
faker.lorem.paragraphs(5)
// 'Quia hic sunt ducimus expedita quo impedit soluta. Quam impedit et ipsum optio. Unde dolores nulla nobis vero et aspernatur officiis.
// Aliquam dolorem temporibus dolores voluptatem voluptatem qui nostrum quia. Sit hic facilis rerum eius. Beatae doloribus nesciunt iste ipsum.
// Natus nam eum nulla voluptas molestiae fuga libero nihil voluptatibus. Sed quam numquam eum ipsam temporibus eaque ut et. Enim quas debitis quasi quis. Vitae et vitae.
// Repellat voluptatem est laborum illo harum sed reprehenderit aut. Quo sit et. Exercitationem blanditiis totam velit ad dicta placeat.
// Rerum non eum incidunt amet quo. Eaque laborum ut. Recusandae illo ab distinctio veritatis. Cum quis architecto ad maxime a.'
faker.lorem.paragraphs(2, '<br/>\n')
// 'Eos magnam aut qui accusamus. Sapiente quas culpa totam excepturi. Blanditiis totam distinctio occaecati dignissimos cumque atque qui officiis.<br/>
// Nihil quis vel consequatur. Blanditiis commodi deserunt sunt animi dolorum. A optio porro hic dolorum fugit aut et sint voluptas. Minima ad sed ipsa est non dolores.'
faker.lorem.paragraphs({ min: 1, max: 3 })
// 'Eum nam fugiat laudantium.
// Dignissimos tempore porro necessitatibus commodi nam.
// Veniam at commodi iste perferendis totam dolorum corporis ipsam.'
Generates a space separated list of words beginning with a capital letter and ending with a period.
Optional
wordCount: number | { max: number; min: number }The number of words, that should be in the sentence. Defaults to a random number between 3
and 10
.
The maximum number of words to generate.
The minimum number of words to generate.
Generates the given number of sentences.
Optional
sentenceCount: number | { max: number; min: number }The number of sentences to generate. Defaults to a random number between 2
and 6
.
The maximum number of sentences to generate.
The minimum number of sentences to generate.
Optional
separator: stringThe separator to add between sentences. Defaults to ' '
.
faker.lorem.sentences() // 'Iste molestiae incidunt aliquam possimus reprehenderit eum corrupti. Deleniti modi voluptatem nostrum ut esse.'
faker.lorem.sentences(2) // 'Maxime vel numquam quibusdam. Dignissimos ex molestias quos aut molestiae quam nihil occaecati maiores.'
faker.lorem.sentences(2, '\n')
// 'Et rerum a unde tempora magnam sit nisi.
// Et perspiciatis ipsam omnis.'
faker.lorem.sentences({ min: 1, max: 3 }) // 'Placeat ex natus tenetur repellendus repellendus iste. Optio nostrum veritatis.'
Generates a slugified text consisting of the given number of hyphen separated words.
Optional
wordCount: number | { max: number; min: number }The number of words to generate. Defaults to 3
.
The maximum number of words to generate.
The minimum number of words to generate.
Generates a random text based on a random lorem method.
faker.lorem.text() // 'Doloribus autem non quis vero quia.'
faker.lorem.text()
// 'Rerum eum reiciendis id ipsa hic dolore aut laborum provident.
// Quis beatae quis corporis veritatis corrupti ratione delectus sapiente ut.
// Quis ut dolor dolores facilis possimus tempore voluptates.
// Iure nam officia optio cumque.
// Dolor tempora iusto.'
Generates a word of a specified length.
Optional
options: The expected length of the word or the options to use.
Optional
length?: number | { max: number; min: number }The expected length of the word.
Optional
strategy?: "fail" | "closest" | "shortest" | "longest" | "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.Generates a space separated list of words.
Optional
wordCount: number | { max: number; min: number }The number of words to generate. Defaults to 3
.
The maximum number of words to generate.
The minimum number of words to generate.
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
word()
, multiplewords()
, asentence()
, multiplesentences()
,lines()
separated by newlines, oneparagraph()
, or multipleparagraphs()
.The generic
text()
method can be used to generate some text between one sentence and multiple paragraphs, whileslug()
generates an URL-friendly hyphenated string.