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"/>
|
<img src="https://github.com/Marak/colors.js/raw/master/screenshots/colors.png"/>
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
npm install colors -g
|
npm install colors
|
||||||
|
|
||||||
## colors and styles!
|
## colors and styles!
|
||||||
|
|
||||||
@ -64,7 +63,7 @@ By popular demand, `colors` now ships with two types of usages!
|
|||||||
The super nifty way
|
The super nifty way
|
||||||
|
|
||||||
```js
|
```js
|
||||||
require('colors');
|
var colors = require('colors');
|
||||||
|
|
||||||
console.log('hello'.green); // outputs green text
|
console.log('hello'.green); // outputs green text
|
||||||
console.log('i like cake and pies'.underline.red) // outputs red underlined text
|
console.log('i like cake and pies'.underline.red) // outputs red underlined text
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
module['exports'] = function runTheTrap (text, options) {
|
module['exports'] = function runTheTrap (text, options) {
|
||||||
var result = "";
|
var result = "";
|
||||||
|
text = text || "Run the trap, drop the bass";
|
||||||
text = text.split('');
|
text = text.split('');
|
||||||
var trap = {
|
var trap = {
|
||||||
a: ["\u0040", "\u0104", "\u023a", "\u0245", "\u0394", "\u039b", "\u0414"],
|
a: ["\u0040", "\u0104", "\u023a", "\u0245", "\u0394", "\u039b", "\u0414"],
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
// please no
|
// please no
|
||||||
var zalgo = module['exports'] = function zalgo(text, options) {
|
module['exports'] = function zalgo(text, options) {
|
||||||
|
text = text || " he is here ";
|
||||||
var soul = {
|
var soul = {
|
||||||
"up" : [
|
"up" : [
|
||||||
'̍', '̎', '̄', '̅',
|
'̍', '̎', '̄', '̅',
|
||||||
|
|||||||
@ -3,6 +3,6 @@ var colors = require('../colors');
|
|||||||
module['exports'] = (function () {
|
module['exports'] = (function () {
|
||||||
var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
|
var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
|
||||||
return function(letter, i, exploded) {
|
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",
|
"name": "colors",
|
||||||
"description": "get colors in your node.js console like what",
|
"description": "get colors in your node.js console",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"author": "Marak Squires",
|
"author": "Marak Squires",
|
||||||
"homepage": "https://github.com/Marak/colors.js",
|
"homepage": "https://github.com/Marak/colors.js",
|
||||||
@ -10,6 +10,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "http://github.com/Marak/colors.js.git"
|
"url": "http://github.com/Marak/colors.js.git"
|
||||||
},
|
},
|
||||||
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node tests/basic-test.js && node tests/safe-test.js"
|
"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