mad-libber
v1.1.0
Published
Creates a random sentence by replacing keywords - mad libs style.
Downloads
2
Readme
mad-libber
Creates a random sentence by replacing keywords - mad libs style.
Install
$ npm install --save mad-libber
Usage
const madlibs = require('mad-libber');
const sentence = '${noun1} likes ${?to? verb1}. ${noun2} likes ${?to? verb2}.';
const data = {
noun: ["Tim", "MM", "Dan"],
verb: ["?to? party", "?to? sleep", "staring, slack-jawed, into the abyss"]
};
madlibs(sentence, data);
//=> "MM likes to party. Tim likes to sleep."