Number of words in the name (default: random between 2-3)
A space-separated string of random words (each 3-7 chars by default)
RandomGenerator.name(); // e.g. "lorem ipsum" (2-3 words)
RandomGenerator.name(1); // e.g. "dolor" (single word)
RandomGenerator.name(3); // e.g. "sit amet consectetur" (3 words)
// Generate test user names
const users = Array.from({ length: 10 }, () => ({
id: RandomGenerator.alphaNumeric(8),
name: RandomGenerator.name(),
email: `${RandomGenerator.name(1)}@test.com`
}));
// Create random author names for blog posts
const authorName = RandomGenerator.name();
Generates a random name-like string with realistic length variation.
Creates a name by generating a paragraph with 2-3 words (randomly chosen). The resulting string resembles typical human names in structure and length. Each word is between 3-7 characters by default, creating realistic-looking names.