dummy-text-generator
v1.0.3
Published
Simple random lorem ipsum generator
Downloads
79
Maintainers
Readme
Dummy Text Generator
Installation
Using npm:
npm install --save dummy-text-generator
Using yarn:
yarn add dummy-text-generator
Using
In Nodejs
const loremGenerator = require('dummy-text-generator');
// const { generateWord, generateSentence, generateParagraph } = require('dummy-text-generator');
// const generateWord = require('dummy-text-generator').generateWord;
loremGenerator.generateWord();
// Output: Lorem
loremGenerator.generateSentence(10);
// Output: Excepteur laboris ea labore quis sunt laborum reprehenderit ea duis.
loremGenerator.generateParagraph(5, 10);
// Output: Excepteur minim amet lorem velit in mollit laborum magna cillum. Qui aliquip duis excepteur id est dolore eiusmod ea adipisicing. Laboris aute sint culpa aliquip laboris enim aliqua exercitation ut. Ea enim deserunt reprehenderit culpa pariatur nostrud laboris anim eiusmod. Ullamco nisi duis cillum elit id officia veniam excepteur velit.
In Browser
CDN:
<script src="https://cdn.jsdelivr.net/npm/dummy-text-generator@<tags_version>/dist/lorem-generator.min.js"></script>
Using loremGenerator
object
In ES modules
import loremGenerator from 'dummy-text-generator';
import { generateWord, generateSentence, generateParagraph } from 'dummy-text-generator';
API
generateWord() - Return random 1 word
generateSentence(maxWord) - Return random 1 sentence
- maxWord (require): The total number of words in a sentence. Must be a positive integer (eg: 10)
generateParagraph(maxSentence, maxWord) - Return random 1 paragraph
- maxSentence (require): The total number of sentences in a paragraph. Must be a positive integer (eg: 5)
- maxWord (require): The total number of words in a sentence. Must be a positive integer (eg: 10)