mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-28 18:40:09 +00:00
[minor] [fix] Add defaults for .trap and .zalgo. .random now using correct api. Update docs and screenshot.
This commit is contained in:
parent
dfb15b5538
commit
936cf564be
@ -4,10 +4,9 @@
|
||||
|
||||
<img src="https://github.com/Marak/colors.js/raw/master/screenshots/colors.png"/>
|
||||
|
||||
|
||||
## 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
|
||||
|
||||
@ -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"],
|
||||
|
||||
@ -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" : [
|
||||
'̍', '̎', '̄', '̅',
|
||||
|
||||
@ -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);
|
||||
};
|
||||
})();
|
||||
@ -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"
|
||||
},
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 78 KiB |
Loading…
x
Reference in New Issue
Block a user