Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #224 from Marak/develop
v1.2.3
  • Loading branch information
DABH committed Apr 30, 2018
2 parents 97cc55e + 64a2ea2 commit 1e0c77c
Show file tree
Hide file tree
Showing 24 changed files with 1,575 additions and 335 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,11 @@
{
"extends": "google",
"rules": {
"no-var": "off",
"prefer-const": "off",
"eol-last": ["error", "always"],
"require-jsdoc": "off",
"guard-for-in": "off",
"prefer-rest-params": "off"
}
}
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
**/*.sw*
node_modules
5 changes: 5 additions & 0 deletions .travis.yml
@@ -1,5 +1,6 @@
language: node_js
node_js:
- "10"
- "9"
- "8"
- "7"
Expand All @@ -10,3 +11,7 @@ node_js:
- "0.11"
- "0.10"
- "0.8"
script:
- npm install
- "./node_modules/.bin/eslint . "
- npm test
8 changes: 7 additions & 1 deletion ROADMAP.md
Expand Up @@ -7,9 +7,15 @@ Here we describe upcoming releases and the key features/fixes they include. Don
### 1.3.0
* Support custom colors

### 1.2.2
### 1.2.4
* Refactor tests to use a testing library like jest (only affects dev/testing)

### 1.2.3 (4/30/18)
* ~~Add ESLint and lint all the things~~

### 1.2.2 (4/30/18)
* ~~Fix multiline string support, Typescript fixes, etc.~~

### ~~1.2.0 (release date: about 3/5/18, barring any new issues)~~
* ~~Built-in Typescript definitions~~
* ~~Key bug fixes for webpack/bundlers, webstorm, etc.~~
Expand Down
49 changes: 26 additions & 23 deletions examples/normal-usage.js
@@ -1,34 +1,36 @@
var colors = require('../lib/index');

console.log("First some yellow text".yellow);
console.log('First some yellow text'.yellow);

console.log("Underline that text".yellow.underline);
console.log('Underline that text'.yellow.underline);

console.log("Make it bold and red".red.bold);
console.log('Make it bold and red'.red.bold);

console.log(("Double Raindows All Day Long").rainbow)
console.log(('Double Raindows All Day Long').rainbow);

console.log("Drop the bass".trap)
console.log('Drop the bass'.trap);

console.log("DROP THE RAINBOW BASS".trap.rainbow)
console.log('DROP THE RAINBOW BASS'.trap.rainbow);

// styles not widely supported
console.log('Chains are also cool.'.bold.italic.underline.red);

console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported

console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse + ' styles! '.yellow.bold); // styles not widely supported
console.log("Zebras are so fun!".zebra);
// styles not widely supported
console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse
+ ' styles! '.yellow.bold);
console.log('Zebras are so fun!'.zebra);

//
// Remark: .strikethrough may not work with Mac OS Terminal App
//
console.log("This is " + "not".strikethrough + " fun.");
console.log('This is ' + 'not'.strikethrough + ' fun.');

console.log('Background color attack!'.black.bgWhite)
console.log('Use random styles on everything!'.random)
console.log('America, Heck Yeah!'.america)
console.log('Background color attack!'.black.bgWhite);
console.log('Use random styles on everything!'.random);
console.log('America, Heck Yeah!'.america);


console.log('Setting themes is useful')
console.log('Setting themes is useful');

//
// Custom themes
Expand All @@ -45,17 +47,17 @@ colors.setTheme({
help: 'cyan',
warn: 'yellow',
debug: 'blue',
error: 'red'
error: 'red',
});

// outputs red text
console.log("this is an error".error);
console.log('this is an error'.error);

// outputs yellow text
console.log("this is a warning".warn);
console.log('this is a warning'.warn);

// outputs grey text
console.log("this is an input".input);
console.log('this is an input'.input);

console.log('Generic logging theme as file'.green.bold.underline);

Expand All @@ -67,12 +69,13 @@ try {
}

// outputs red text
console.log("this is an error".error);
console.log('this is an error'.error);

// outputs yellow text
console.log("this is a warning".warn);
console.log('this is a warning'.warn);

// outputs grey text
console.log("this is an input".input);
console.log('this is an input'.input);

// console.log("Don't summon".zalgo)

//console.log("Don't summon".zalgo)
45 changes: 23 additions & 22 deletions examples/safe-string.js
@@ -1,37 +1,39 @@
var colors = require('../safe');

console.log(colors.yellow("First some yellow text"));
console.log(colors.yellow('First some yellow text'));

console.log(colors.yellow.underline("Underline that text"));
console.log(colors.yellow.underline('Underline that text'));

console.log(colors.red.bold("Make it bold and red"));
console.log(colors.red.bold('Make it bold and red'));

console.log(colors.rainbow("Double Raindows All Day Long"))
console.log(colors.rainbow('Double Raindows All Day Long'));

console.log(colors.trap("Drop the bass"))
console.log(colors.trap('Drop the bass'));

console.log(colors.rainbow(colors.trap("DROP THE RAINBOW BASS")));
console.log(colors.rainbow(colors.trap('DROP THE RAINBOW BASS')));

console.log(colors.bold.italic.underline.red('Chains are also cool.')); // styles not widely supported
// styles not widely supported
console.log(colors.bold.italic.underline.red('Chains are also cool.'));

// styles not widely supported
console.log(colors.green('So ') + colors.underline('are') + ' '
+ colors.inverse('inverse') + colors.yellow.bold(' styles! '));

console.log(colors.green('So ') + colors.underline('are') + ' ' + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); // styles not widely supported
console.log(colors.zebra('Zebras are so fun!'));

console.log(colors.zebra("Zebras are so fun!"));

console.log("This is " + colors.strikethrough("not") + " fun.");
console.log('This is ' + colors.strikethrough('not') + ' fun.');


console.log(colors.black.bgWhite('Background color attack!'));
console.log(colors.random('Use random styles on everything!'))
console.log(colors.random('Use random styles on everything!'));
console.log(colors.america('America, Heck Yeah!'));

console.log('Setting themes is useful')
console.log('Setting themes is useful');

//
// Custom themes
//
//console.log('Generic logging theme as JSON'.green.bold.underline);
// console.log('Generic logging theme as JSON'.green.bold.underline);
// Load theme with JSON literal
colors.setTheme({
silly: 'rainbow',
Expand All @@ -43,17 +45,17 @@ colors.setTheme({
help: 'cyan',
warn: 'yellow',
debug: 'blue',
error: 'red'
error: 'red',
});

// outputs red text
console.log(colors.error("this is an error"));
console.log(colors.error('this is an error'));

// outputs yellow text
console.log(colors.warn("this is a warning"));
console.log(colors.warn('this is a warning'));

// outputs grey text
console.log(colors.input("this is an input"));
console.log(colors.input('this is an input'));


// console.log('Generic logging theme as file'.green.bold.underline);
Expand All @@ -62,15 +64,14 @@ console.log(colors.input("this is an input"));
colors.setTheme(__dirname + '/../themes/generic-logging.js');

// outputs red text
console.log(colors.error("this is an error"));
console.log(colors.error('this is an error'));

// outputs yellow text
console.log(colors.warn("this is a warning"));
console.log(colors.warn('this is a warning'));

// outputs grey text
console.log(colors.input("this is an input"));
console.log(colors.input('this is an input'));

// console.log(colors.zalgo("Don't summon him"))



0 comments on commit 1e0c77c

Please sign in to comment.