Documentation
    Preparing search index...
    • Generates random multi-paragraph content with customizable structure.

      Creates content consisting of multiple paragraphs separated by double newlines. Accepts an optional configuration object to control content structure including paragraph count, sentences per paragraph, and word character lengths. Ideal for generating realistic-looking text content for testing.

      Parameters

      • Optionalprops: Partial<
            {
                paragraphs: number;
                sentenceMax: number;
                sentenceMin: number;
                wordMax: number;
                wordMin: number;
            },
        >

        Optional configuration object with paragraph, sentence, and word parameters

      Returns string

      A string containing the generated multi-paragraph content

        // Generate with all defaults
      const article = RandomGenerator.content();

      // Specific structure: 5 paragraphs, 15-25 sentences each, 4-8 char words
      const longContent = RandomGenerator.content({
      paragraphs: 5,
      sentenceMin: 15,
      sentenceMax: 25,
      wordMin: 4,
      wordMax: 8
      });

      // Short content with brief sentences
      const shortContent = RandomGenerator.content({
      paragraphs: 2,
      sentenceMin: 5,
      sentenceMax: 8,
      wordMin: 2,
      wordMax: 4
      });

      // Generate blog post content
      const blogPost = {
      title: RandomGenerator.name(3),
      content: RandomGenerator.content({
      paragraphs: 4,
      sentenceMin: 10,
      sentenceMax: 20,
      wordMin: 3,
      wordMax: 7
      }),
      summary: RandomGenerator.paragraph({ sentences: 2 })
      };

      // Create test data for CMS
      const pages = Array.from({ length: 10 }, () => ({
      id: RandomGenerator.alphaNumeric(8),
      content: RandomGenerator.content({
      paragraphs: randint(2, 6),
      sentenceMin: 8,
      sentenceMax: 15
      })
      }));