@digital-taco/ipsum-generator
v0.2.0
Published
A NodeJS generalized lorem-ipsum generator that can use any word set.
Downloads
8
Readme
Ipsum Generator
Bask in the hunnit-p dank dopeness of this heckin woke generator. So yolo. So lit.
CLI
Install globally to use the ipsum-generator
CLI.
> npm install -g @digital-taco/ipsum-generator
The following will echo out ipsum as paragraphs or sentences
> ipsum-generator [paragraph|sentence] [<number of paragraphs or sentences>] [<number of words/sentences in sentence/paragraph>] [--wordsets [...any wordsets ipsum-generator provides]]
API
import { paragraph } from '@digital-taco/ipsum-generator'
// OR if in Node
// const { paragraph } = require('@digital-taco/ipsum-generator')
import { slang, starWars } from '@digital-taco/ipsum-generator'
import yourOwnWordSet from 'somewhere'
// With just default lorem ipsum
const loremSentence = sentence(5 /* number of words in the sentence (optional - default will randomize between 5-15) */)
// With specific word sets
const mixedSentence = sentence(5, [slang, starWars, yourOwnWordSet])
// API is the same for paragraphs
const loremParagraph = paragraph(5 /* number of sentences in the paragraph (optional - default will randomize between 3-10) */)
const mixedParagraph = paragraph(5, [slang, starWars, yourOwnWordSet])
const
Bound Generator Functions
You can also use ipsumGenerators
to get back a sentence
and paragraph
function that work the same, but are bound to the provided word sets.
import { ipsumGenerators } from '@digital-taco/ipsum-generator'
// These two functions work the same as the ones provided from ipsum-generator, but will use the slang and starWars word sets by default.
const { sentence, paragraph } = ipsumGenerators([slang, starWars])
Available Word Sets
Any of these can be imported from ipsum-generator and used. You can use your own custom word sets alongside it.
lorem
- Classic lorem ipsumslang2010s
- Slang words from 2010-2020starWars
- Characters, planets, phrases, and more from the Star Wars universe
Using a Custom Word Set
Using a custom word set is easy. It just needs to be an array of strings.
const fruits = [
'apple',
'tomato',
'banana',
'peach',
'mango',
'guava'
]
const fruitIpsum = paragraph(5, [fruits])
TODO:
- Minify the output
- Publish it as package
- Create showcase site (based off old one)
- Add more word sets (marvel? star trek? meats? colors? binary?)