An open API service indexing awesome lists of open source software.

https://github.com/jharrilim/madlibs

`The ${"adjective"}, ${"adjective"}, ${"noun"} jumped over the ${"adjective"} ${"noun"}`
https://github.com/jharrilim/madlibs

literal madlibs tagged template

Last synced: 3 months ago
JSON representation

`The ${"adjective"}, ${"adjective"}, ${"noun"} jumped over the ${"adjective"} ${"noun"}`

Awesome Lists containing this project

README

          

# MadLibs

[![Build Status]](https://dev.azure.com/josephharrisonlim/josephharrisonlim/_build/latest?definitionId=4&branchName=master)
[![Version]](https://www.npmjs.com/package/@jharrilim/madlibs)
[![Downloads]](https://www.npmjs.com/package/@jharrilim/madlibs)

> An entirely useless MadLibs library that demonstrates how you can process tagged template strings.

## Install

```sh
npm i @jharrilim/madlibs
```

## Usage

```ts
import { MadLibs } from '@jharrilim/madlibs';

const madlibs = new MadLibs({
adjective: ['speedy'],
noun: ['sloth', 'ocean'],
'verb ending in ing': ['flying'],
});

console.log(madlibs.compile`
The ${"adjective"} ${"noun"} was ${"verb ending in ing"} over the ${"noun"}
`.join(''));

// Output: The speedy sloth was flying over the ocean
```

[Version]: https://img.shields.io/npm/v/@jharrilim/madlibs?style=flat-square
[Downloads]: https://img.shields.io/npm/dt/@jharrilim/madlibs?style=flat-square
[Build Status]: https://dev.azure.com/josephharrisonlim/josephharrisonlim/_apis/build/status/jharrilim.madlibs?branchName=master