GitHunt
JH

jharrilim/madlibs

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

MadLibs

Build Status
Version
Downloads

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

Install

npm i @jharrilim/madlibs

Usage

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

Languages

TypeScript94.4%JavaScript5.6%

Contributors

MIT License
Created October 7, 2019
Updated March 9, 2023
jharrilim/madlibs | GitHunt