Optionalprops: Partial<{ sentences: number; wordMax: number; wordMin: number }>Optional configuration object with sentences count and word length ranges
A string containing the generated paragraph
// Generate with defaults (random 2-5 words, 3-7 characters each)
RandomGenerator.paragraph(); // e.g. "lorem ipsum dolor"
// Specific number of sentences
RandomGenerator.paragraph({ sentences: 5 }); // "lorem ipsum dolor sit amet"
// Custom word length ranges
RandomGenerator.paragraph({ sentences: 4, wordMin: 2, wordMax: 5 });
// "ab cd ef gh"
// Generate product descriptions
const description = RandomGenerator.paragraph({
sentences: 8,
wordMin: 4,
wordMax: 8
});
// Create test content for forms
const placeholder = RandomGenerator.paragraph({
sentences: 3,
wordMin: 5,
wordMax: 10
});
Generates a random paragraph with configurable sentence structure.
Creates a paragraph consisting of a specified number of "sentences" (words). Each sentence is a random alphabetic string, and sentences are joined with spaces. Accepts an optional configuration object for fine-tuned control over the paragraph structure.