Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luludotdev/mattophobia
Generate Mattophobia-like sentences
https://github.com/luludotdev/mattophobia
generator javascript js matt mattophobia nerdcubed says
Last synced: about 1 month ago
JSON representation
Generate Mattophobia-like sentences
- Host: GitHub
- URL: https://github.com/luludotdev/mattophobia
- Owner: luludotdev
- License: isc
- Created: 2018-02-20T17:41:39.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T16:16:18.000Z (about 2 years ago)
- Last Synced: 2024-12-12T17:48:49.966Z (about 1 month ago)
- Topics: generator, javascript, js, matt, mattophobia, nerdcubed, says
- Language: TypeScript
- Homepage: https://mattophobia.com
- Size: 863 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 💢 Mattophobia
[![NPM version](https://img.shields.io/npm/v/mattophobia.svg?maxAge=3600)](https://www.npmjs.com/package/mattophobia)
[![NPM downloads](https://img.shields.io/npm/dt/mattophobia.svg?maxAge=3600)](https://www.npmjs.com/package/mattophobia)
[![Build status](https://travis-ci.org/lolPants/mattophobia.svg)](https://travis-ci.org/lolPants/mattophobia)
[![Dependencies](https://img.shields.io/david/lolpants/mattophobia.svg?maxAge=3600)](https://david-dm.org/lolpants/mattophobia)
[![Coverage Status](https://coveralls.io/repos/github/lolPants/mattophobia/badge.svg?branch=master)](https://coveralls.io/github/lolPants/mattophobia?branch=master)_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:
```js
const mattophobia = require('mattophobia')
````mattophobia()` is an [ES6 generator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator) that creates an [`IterableIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
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
```js
// Import the module
const mattophobia = require('mattophobia')// Limit to tweet length
const generator = mattophobia({ maxLength: 280 })
console.log(generator.next().value)
```## 💙 Special Thanks
* [Python Fork](https://github.com/DerpyChap/mattophobia_says)