lorem-ipsum

  • Version 3.0.0
  • Published
  • 40 kB
  • No dependencies
  • MIT license

Install

npm i lorem-ipsum
yarn add lorem-ipsum
pnpm add lorem-ipsum

Overview

Generates lorem ipsum placeholder text for Node.js, Deno, browsers, and React Native. Developed with Bun.

Index

Functions

function loremIpsum

loremIpsum: (options?: LoremIpsumParams) => string;

    Classes

    class Generator

    class Generator {}

      constructor

      constructor(options?: GeneratorOptions);

        property random

        random: Prng;

          property sentencesPerParagraph

          sentencesPerParagraph: Bounds;

            property words

            words: string[];

              property wordsPerSentence

              wordsPerSentence: Bounds;

                method generateRandomInteger

                generateRandomInteger: (min: number, max: number) => number;

                  method generateRandomParagraph

                  generateRandomParagraph: (num?: number) => string;

                    method generateRandomSentence

                    generateRandomSentence: (num?: number) => string;

                      method generateRandomWords

                      generateRandomWords: (num?: number) => string;

                        method pluckRandomWord

                        pluckRandomWord: () => string;

                          class LoremIpsum

                          class LoremIpsum {}

                            constructor

                            constructor(options?: GeneratorOptions, format?: LoremFormat, suffix?: string);

                              property format

                              format: LoremFormat;

                                property generator

                                generator: Generator;

                                  property suffix

                                  suffix?: string;

                                    method formatString

                                    formatString: (value: string) => string;

                                      method formatStrings

                                      formatStrings: (values: string[]) => string[];

                                        method generateParagraphs

                                        generateParagraphs: (num: number) => string;

                                          method generateSentences

                                          generateSentences: (num?: number) => string;

                                            method generateWords

                                            generateWords: (num?: number) => string;

                                              method getLineEnding

                                              getLineEnding: () => string;

                                                Interfaces

                                                interface Bounds

                                                interface Bounds {}

                                                  property max

                                                  max: number;

                                                    property min

                                                    min: number;

                                                      interface GeneratorOptions

                                                      interface GeneratorOptions {}

                                                        property random

                                                        random?: Prng;

                                                          property sentencesPerParagraph

                                                          sentencesPerParagraph?: Bounds;

                                                            property words

                                                            words?: string[];

                                                              property wordsPerSentence

                                                              wordsPerSentence?: Bounds;

                                                                interface LoremIpsumParams

                                                                interface LoremIpsumParams {}

                                                                  property count

                                                                  count?: number;

                                                                    property format

                                                                    format?: LoremFormat;

                                                                      property paragraphLowerBound

                                                                      paragraphLowerBound?: number;

                                                                        property paragraphUpperBound

                                                                        paragraphUpperBound?: number;

                                                                          property random

                                                                          random?: Prng;

                                                                            property sentenceLowerBound

                                                                            sentenceLowerBound?: number;

                                                                              property sentenceUpperBound

                                                                              sentenceUpperBound?: number;

                                                                                property suffix

                                                                                suffix?: string;

                                                                                  property units

                                                                                  units?: LoremUnit;

                                                                                    property words

                                                                                    words?: string[];

                                                                                      Type Aliases

                                                                                      type LoremFormat

                                                                                      type LoremFormat = 'plain' | 'html';

                                                                                        type LoremUnit

                                                                                        type LoremUnit =
                                                                                        | 'words'
                                                                                        | 'word'
                                                                                        | 'sentences'
                                                                                        | 'sentence'
                                                                                        | 'paragraphs'
                                                                                        | 'paragraph';

                                                                                          type Prng

                                                                                          type Prng = () => number;

                                                                                            Package Files (1)

                                                                                            Dependencies (0)

                                                                                            No dependencies.

                                                                                            Dev Dependencies (0)

                                                                                            No dev dependencies.

                                                                                            Peer Dependencies (0)

                                                                                            No peer dependencies.

                                                                                            Badge

                                                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/lorem-ipsum.

                                                                                            • Markdown
                                                                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/lorem-ipsum)
                                                                                            • HTML
                                                                                              <a href="https://www.jsdocs.io/package/lorem-ipsum"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>