1.1.0 • Published 8 years ago
mad-libber v1.1.0
mad-libber
Creates a random sentence by replacing keywords - mad libs style.
Install
$ npm install --save mad-libberUsage
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."