hello-mad-world
v1.0.4
Published
Spit out lyrics from the song Mad World by Tears for Fears.
Downloads
6
Maintainers
Readme
Description
A simple text-generator using lyrics from the popular 1983 song Mad World by Tears for Fears.
Installation
This package is publicly available through npm (hello-mad-world). Navigate to the root of your project directory and run:
npm install hello-mad-world
Simple Usage
var text = require("./hello-mad-world/index.js");
console.log(text()); // outputs "All around me are familiar faces"
Advanced Usage
var HelloMadWorld = require("./hello-mad-world/index.js");
// spit out 10 lines
for (var i = 0; i < 10; ++i) {
console.log("LINE " + (i + 1) + " SAYS: " + HelloMadWorld.line());
}
// spit out a given line
console.log("LINE 23 SAYS: " + HelloMadWorld.line(24));
// reset the line counter back to 0
HelloMadWorld.reset();
// spit out the first line
console.log("LINE 1 SAYS: " + HelloMadWorld.line());
// super shorthand
console.log("SHORTHAND FOR NEXT LINE SAYS: " + HelloMadWorld());
Testing
Navigate to the root of the package and run:
node test.js