mattophobia
v1.1.3
Published
Generate Mattophobia-like sentences
Downloads
29
Readme
💢 Mattophobia
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)