UNPKG

nepali-lorem-ipsum

Version:

A lightweight Lorem Ipsum generator for Nepali placeholder text in Devanagari script. Perfect for mocking up UI designs, testing fonts, or generating content for Nepali-language applications.

17 lines (16 loc) 833 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSentence = getSentence; exports.getNepaliLorem = getNepaliLorem; const nepali_words_1 = __importDefault(require("./nepali-words")); function getSentence(wordCount = 15) { const shuffled = [...nepali_words_1.default].sort(() => 0.5 - Math.random()); return shuffled.slice(0, wordCount).join(' ') + '।'; } function getNepaliLorem(options = {}) { const { paragraphs = 3, sentencesPerParagraph = 5, wordsPerSentence = 15 } = options; return Array.from({ length: paragraphs }, () => Array.from({ length: sentencesPerParagraph }, () => getSentence(wordsPerSentence)).join(' ')).join('\n\n'); }