diff --git a/ReadMe.md b/ReadMe.md index b61ce48..89fd0d3 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -4,10 +4,9 @@ - ## Installation - npm install colors -g + npm install colors ## colors and styles! @@ -64,7 +63,7 @@ By popular demand, `colors` now ships with two types of usages! The super nifty way ```js -require('colors'); +var colors = require('colors'); console.log('hello'.green); // outputs green text console.log('i like cake and pies'.underline.red) // outputs red underlined text diff --git a/lib/custom/trap.js b/lib/custom/trap.js index 5a8f2a4..3f09143 100644 --- a/lib/custom/trap.js +++ b/lib/custom/trap.js @@ -1,5 +1,6 @@ module['exports'] = function runTheTrap (text, options) { var result = ""; + text = text || "Run the trap, drop the bass"; text = text.split(''); var trap = { a: ["\u0040", "\u0104", "\u023a", "\u0245", "\u0394", "\u039b", "\u0414"], diff --git a/lib/custom/zalgo.js b/lib/custom/zalgo.js index e94ef9a..4dc20c8 100644 --- a/lib/custom/zalgo.js +++ b/lib/custom/zalgo.js @@ -1,5 +1,6 @@ // please no -var zalgo = module['exports'] = function zalgo(text, options) { +module['exports'] = function zalgo(text, options) { + text = text || " he is here "; var soul = { "up" : [ '̍', '̎', '̄', '̅', diff --git a/lib/maps/random.js b/lib/maps/random.js index 5027f08..5cd101f 100644 --- a/lib/maps/random.js +++ b/lib/maps/random.js @@ -3,6 +3,6 @@ var colors = require('../colors'); module['exports'] = (function () { var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; return function(letter, i, exploded) { - return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]]; + return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 1))]](letter); }; })(); \ No newline at end of file diff --git a/package.json b/package.json index 279ea7a..47966ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "colors", - "description": "get colors in your node.js console like what", + "description": "get colors in your node.js console", "version": "1.0.0", "author": "Marak Squires", "homepage": "https://github.com/Marak/colors.js", @@ -10,6 +10,7 @@ "type": "git", "url": "http://github.com/Marak/colors.js.git" }, + "license": "MIT", "scripts": { "test": "node tests/basic-test.js && node tests/safe-test.js" }, diff --git a/screenshots/colors.png b/screenshots/colors.png index 9f4f074..7200a62 100644 Binary files a/screenshots/colors.png and b/screenshots/colors.png differ