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"}`
- Host: GitHub
- URL: https://github.com/jharrilim/madlibs
- Owner: jharrilim
- License: mit
- Created: 2019-10-06T22:14:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T22:15:05.000Z (over 3 years ago)
- Last Synced: 2025-01-31T16:03:59.683Z (over 1 year ago)
- Topics: literal, madlibs, tagged, template
- Language: TypeScript
- Homepage:
- Size: 258 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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