@bturkis/loremipsum
v1.0.1
Published
Developer-friendly Lorem Ipsum generator with 20+ language support
Maintainers
Readme
@bturkis/loremipsum
Developer-friendly Lorem Ipsum generator with 30+ language support
Features
- 🌍 30+ Languages - Latin, Turkish, English, German, French, Spanish, Arabic, Japanese, Chinese, and more
- 📦 Zero Dependencies - Lightweight and fast
- 🎯 TypeScript Support - Full type definitions included
- 🔄 Reproducible Output - Seed support for consistent results
- 📝 Multiple Formats - Text, HTML, Markdown, JSON
Installation
npm install @bturkis/loremipsum
# or
yarn add @bturkis/loremipsum
# or
pnpm add @bturkis/loremipsumQuick Start
import { paragraphs, sentences, words } from '@bturkis/loremipsum';
// Generate 3 paragraphs
const text = paragraphs(3);
// Generate 5 sentences in Turkish
const turkishText = sentences(5, { locale: 'tr' });
// Generate 10 words in German
const germanWords = words(10, { locale: 'de' });API
paragraphs(count?, options?)
Generate paragraphs of Lorem Ipsum text.
paragraphs(3, { locale: 'la', startWithLorem: true });sentences(count?, options?)
Generate sentences.
sentences(5, { locale: 'en' });words(count?, options?)
Generate individual words.
words(10, { locale: 'tr' });generate(options)
Full control over generation with all format outputs.
import { generate } from '@bturkis/loremipsum';
const result = generate({
count: 2,
type: 'paragraph',
format: 'json',
locale: 'tr',
startWithLorem: true,
seed: 42, // For reproducible output
});
console.log(result.text); // Plain text
console.log(result.html); // <p>...</p>
console.log(result.markdown); // Markdown formatted
console.log(result.json); // { paragraphs: [...] }Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| count | number | 1 | Number of items to generate |
| type | 'paragraph' | 'sentence' | 'word' | 'paragraph' | Type of content |
| format | 'text' | 'html' | 'markdown' | 'json' | 'text' | Output format |
| locale | string | 'la' | Language code |
| startWithLorem | boolean | true | Start with "Lorem ipsum..." |
| seed | number | - | Seed for reproducible output |
getAvailableLocales()
Get list of all supported languages.
import { getAvailableLocales } from '@bturkis/loremipsum';
const locales = getAvailableLocales();
// [{ code: 'la', name: 'Latin', nativeName: 'Latina' }, ...]Available Languages
| Code | Language | Native Name | |------|----------|-------------| | la | Latin | Latina | | tr | Turkish | Türkçe | | en | English | English | | de | German | Deutsch | | fr | French | Français | | es | Spanish | Español | | it | Italian | Italiano | | pt | Portuguese | Português | | nl | Dutch | Nederlands | | pl | Polish | Polski | | ru | Russian | Русский | | ar | Arabic | العربية | | ja | Japanese | 日本語 | | zh | Chinese | 中文 | | ko | Korean | 한국어 | | ... | +15 more | ... |
CLI
Looking for command-line tool? Check out @bturkis/loremipsum-cli
npm install -g @bturkis/loremipsum-cli
lorem -p 3 -l trWeb App
Try it online at loremipsum.neisterse.com
License
MIT © Burak Turkis
