Skip to content

Lightweight, universal javascript module for generating scaffolding text.

License

Notifications You must be signed in to change notification settings

neetjn/foobar-ipsum

 
 

Repository files navigation

foobar-ipsum

npm

build npm version codecov

NPM

About

foobar-ipsum is a lightweight, universal javascript module for generating scaffolding text.

Usage

To install via NPM:

npm install foobar-ipsum

For a quick start using jsdelivr:

<script src="https://cdn.jsdelivr.net/npm/foobar-ipsum/dist/foobar-ipsum.min.js"></script>

foobar-ipsum supports the following options:

size.sentence ; int : Length of a sentence (words).

size.paragraph ; int : Length of a paragraph (sentences).

dictionary ; array : List of words for generator to pool from.

Generator API

word(): Generate a random word given the provided dictionary.

sentence(size = null): Create a random sentence given the provided dictionary and sentence bounds.

paragraph(size = null, eoc = null): Create a random paragraph given the provided dictionary and paragraph bounds.

The generator can be used like so:

import foobarIpsum from 'foobar-ipsum'

const generator = foobarIpsum({
  size: {
    sentence: 10,
    paragraph: 4
  }
})

let word = generator.word()
let sentence = generator.sentence()
let paragraph = generator.paragraph(null, '<br />')

Contributors

Fork Contributors

  • Nickolas Kenyeres
  • Marco Biedermann
  • Martin Grandrath
  • Florian Wendelborn
  • Melvin Tiong

Contributing guidelines are as follows,

  • Any new features must include either a unit test, e2e test, or both.
    • Branches for bugs and features should be structured like so, issue-x-username.
  • Before putting in a pull request, be sure to verify you've built all your changes.
  • Include your name and email in the contributors list.

Copyright (c) 2017 John Nolette Licensed under the MIT license.

About

Lightweight, universal javascript module for generating scaffolding text.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%