npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

loreml

v0.6.1

Published

A markup language for generating random text.

Downloads

40

Readme

LoreML

LoreML is a markup language for generating random text.

Installation

npm i loreml

Usage

import LoreML from 'loreml'

const loreml = new LoreML()

const text = await loreml.parse(`
  <Root seed="123" locale="en">
      <Document>
          <Text repeat="3">
              <Date when="recent" format="yyyy-MM-dd"/>
              <Paragraph />
          </Text>
      </Document>
  </Root>
`)

LoreML Syntax

<Root>

The root element of the document.

  • Attributes
    • seed - A seed value for the random number generator. If not provided, a random seed will be generated.
    • locale - The locale of the generated text. Possible values are:
      • en - English (default)
      • es - Spanish
      • fr - French
      • de - German
      • it - Italian
  • Children
    • Document
    • Template
    • Person
    • Location

<Template>

A template is a named block of text that can be reused in the document.

  • Attributes

    • name - (required) The name of the template.
  • Children

    • Text
  • Example

    <Root>
        <Template name="greeting">
            <Text>
                Greetings {nameVar}
            </Text>
        </Template>
        <Document>
            <Text>
                <UseTemplate ref="greeting" nameVar="Lorem"/>
            </Text>
        </Document>
    </Root>

<Person />

Generates a random person.

  • Attributes

    • ref - (required) A reference to the person for later use.
    • sex - The sex of the person. If not specified, a random one will be picked. Possible values are male and female.
  • Example

    <Root>
        <Person ref="person1" />
        <Document>
            <Text>
                <UsePerson ref="person1" />
            </Text>
        </Document>
    </Root>

<Location />

Generates a random location.

  • Attributes

    • ref - (required) A reference to the location for later use.
  • Example

    <Root>
        <Location ref="location1" />
        <Document>
            <Text>
                <UseLocation ref="location1">
                    <City />
                    <State />
                    <Country />
                </UseLocation>
            </Text>
        </Document>
    </Root>

<Document>

Denotes the output of a text document.

  • Children
    • Text

<Text>

A Text element can contain any number of self-closing elements, other Text tags, and also inline raw text.

  • Attributes

    • repeat - The number of times to repeat the text. If not provided, the text will be repeated once.
    • pick - Sample N children at random. If not provided, all children will be included.
  • Children

    • Text
    • UseTemplate
    • UsePerson
    • Sentence
    • Paragraph
    • Date
    • UniformInt
    • UniformFloat

<UseTemplate />

Inserts a pre-defined template into the document.

  • Attributes

    • ref - (required) The name of the template to use.
    • [varName: string]: string - Variables to replace in the template.
  • Example

      <Root>
          <Template name="greeting">
              <Text>
                  Greetings {nameVar}
              </Text>
          </Template>
          <Document>
              <Text>
              <UseTemplate
                  ref="greeting"
                  nameVar="Lorem"
              />
              </Text>
          </Document>
      </Root>

<UseLocation />

Inserts a pre-defined location into the document. Uses child elements to specify which properties of the location to include.

  • Attributes

    • ref - (required) The reference of the location to use.
  • Children

    • Address
    • Street
    • City
    • State
    • Zip
    • Country
  • Example

      <Root>
          <Location ref="location1" />
          <Document>
              <Text>
                  <UseLocation ref="location1">
                      <City />
                      <State />
                      <Country />
                  </UseLocation>
              </Text>
          </Document>
      </Root>

<UsePerson />

Inserts a pre-defined person into the document. Uses child elements to specify which properties of the person to include.

  • Attributes

    • ref - (required) The reference of the person to use.
  • Children

    • Sex
    • Prefix
    • FirstName
    • LastName
    • MiddleName
    • FullName
    • Email
    • Phone
    • Address
    • Street
    • City
    • State
    • Zip
    • Country
  • Example

      <Root>
          <Person ref="person1" />
          <Document>
              <Text>
                  <UsePerson ref="person1">
                      <FirstName />
                      <LastName />
                      <Email />
                  </UsePerson>
              </Text>
          </Document>
      </Root>

<Sentence />

Generates a sentence of lorem ipsum text.

  • Attributes

    • min - The minimum number of words in the sentence. (Default: 3).
    • max - The maximum number of words in the sentence. (Default: 10).
  • Example

    <Root>
        <Document>
            <Text>
                <Sentence min="5" max="10" />
            </Text>
        </Document>
    </Root>

<Paragraph />

Generates a paragraph of lorem ipsum text.

  • Attributes

    • min - The minimum number of sentences in the paragraph. (Default: 3).
    • max - The maximum number of sentences in the paragraph. (Default: 10).
  • Example

    <Root>
        <Document>
            <Text>
                <Paragraph min="5" max="10" />
            </Text>
        </Document>
    </Root>

<Date />

Generates a random date.

  • Attributes

    • when - The time frame of the date. Possible values are recent, past, soon, future, anytime. (Default: anytime).
    • format - The format of the date. See date-format (npm) for possible values.
  • Example

    <Root>
        <Document>
            <Text>
                <Date when="soon" format="yyyy-MM-dd"/>
            </Text>
        </Document>
    </Root>

<UniformInt />

Generates a uniformly sampled random integer.

  • Attributes

    • min - The minimum value of the integer. (Default: 0).
    • max - The maximum value of the integer. (Default: 10).
  • Example

    <Root>
        <Document>
            <Text>
                <UniformInt min="5" max="10" />
            </Text>
        </Document>
    </Root>

<UniformFloat />

Generates a uniformly sampled random float.

  • Attributes

    • min - The minimum value of the float. (Default: 0).
    • max - The maximum value of the float. (Default: 10).
  • Example

    <Root>
        <Document>
            <Text>
                <UniformFloat min="5" max="10" />
            </Text>
        </Document>
    </Root>