0.3.0 • Published 5 years ago

gen-ipsum v0.3.0

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

gen-ipsum

gen-ipsum is a small, easy to use, powerfull lorem ipsum generator, written in TypeScript

Installation

you can install gen-ipsum via the npm package manager.

npm install gen-ipsum

Usage

const ipsum = require('gen-ipsum');

ipsum.generate({
    words: 100,                 // how many yowrds do you want to generate
    startWithLoremIpsum: true,  // force the generator to set the first two words to "lorem ipsum"
    htmlOptions: {              // options for generating html lorem ipsum    
        wrapInTag: 'p',         // surround the generated lorem ipsum in an html tag with the given tagName
        color: 'red'            // color the generated lorem ipsum text with the given color (include the # when you pass an hex color value)
    }
}); 
// returns 100 random words of lorem ipsum, starting with "lorem ipsum"

Options

The options are the "thing" which makes this generator special.
You can pass an JavaScript object to the generate function to specity very presice what output you want.

interface IGeneratorOptions { // The TypeScript interface representing the options object
    words: number;                  // how many words do you want to generate
    startWithLoremIpsum: boolean;   // force the generator to start with "lorem ipsum"
}

Contributing

If you want to help development, you can either use / test the library and report bug via the github issue manager or you can fork this repository and send Pull requests. For major changes, please first submit an issue or contact me per E-Mail.

Roadmap

Give the use the oppertubity to pass options to the generate function to specify how many words he wants and e.g. let the generated lorem ipsum start with "lorem ipsum"

License

MIT