mattophobia
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

💢 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

Readme

Keywords

none

Package Sidebar

Install

npm i mattophobia

Weekly Downloads

0

Version

1.1.3

License

ISC

Unpacked Size

13.7 kB

Total Files

16

Last publish

Collaborators

  • lolpants