npm.io
1.1.3 • Published 5 years ago

mattophobia

Licence
ISC
Version
1.1.3
Deps
0
Size
13 kB
Vulns
0
Weekly
0
Stars
2

Mattophobia

NPM version NPM downloads Build status Dependencies Coverage Status

Generate Mattophobia-like sentences

Installation

The package is on the NPM registry as mattophobia. Simply install it with your NPM client of choice.

Usage

First, import the module:

const mattophobia = require('mattophobia')

mattophobia() is an ES6 generator function that creates an IterableIterator<string>. It returns an infinite series of Mattophobia strings.

Options

You can pass in an object with options when instantiating the generator.

Option Type Default Description
ings string[] see constants.ts Words ending with -ing for the generator
swears string[] see constants.ts Profanity for the generator
standalone string[] see constants.ts Standalone phrases for the generator
minWords number 4 Minimum number of words per sentence
maxWords number 18 Maximum number of words per sentence
maxLength number 140 Maximum length of the string. Set to < 1 for no limit.
Example
// Import the module
const mattophobia = require('mattophobia')

// Limit to tweet length
const generator = mattophobia({ maxLength: 280 })
console.log(generator.next().value)

Special Thanks