
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
LoreML is a markup language for generating random text.
npm i loreml
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>
`)
<Root>The root element of the document.
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 - Spanishfr - Frenchde - Germanit - ItalianDocumentTemplatePersonLocation<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
TextExample
<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.
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
TextUseTemplateUsePersonSentenceParagraphDateUniformIntUniformFloat<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
AddressStreetCityStateZipCountryExample
<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
SexPrefixFirstNameLastNameMiddleNameFullNameEmailPhoneAddressStreetCityStateZipCountryExample
<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>
v0.6.1
Build fixes.
FAQs
A markup language for generating random text.
We found that loreml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.