| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | var colors = require('../lib/index'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('First some yellow text'.yellow); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('Underline that text'.yellow.underline); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('Make it bold and red'.red.bold); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log(('Double Raindows All Day Long').rainbow); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('Drop the bass'.trap); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('DROP THE RAINBOW BASS'.trap.rainbow); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | // styles not widely supported
 | 
					
						
							|  |  |  | console.log('Chains are also cool.'.bold.italic.underline.red); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | // styles not widely supported
 | 
					
						
							|  |  |  | console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse | 
					
						
							|  |  |  |   + ' styles! '.yellow.bold); | 
					
						
							|  |  |  | console.log('Zebras are so fun!'.zebra); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Remark: .strikethrough may not work with Mac OS Terminal App
 | 
					
						
							|  |  |  | //
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('This is ' + 'not'.strikethrough + ' fun.'); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('Background color attack!'.black.bgWhite); | 
					
						
							|  |  |  | console.log('Use random styles on everything!'.random); | 
					
						
							|  |  |  | console.log('America, Heck Yeah!'.america); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('Setting themes is useful'); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Custom themes
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | console.log('Generic logging theme as JSON'.green.bold.underline); | 
					
						
							|  |  |  | // Load theme with JSON literal
 | 
					
						
							|  |  |  | colors.setTheme({ | 
					
						
							|  |  |  |   silly: 'rainbow', | 
					
						
							|  |  |  |   input: 'grey', | 
					
						
							|  |  |  |   verbose: 'cyan', | 
					
						
							|  |  |  |   prompt: 'grey', | 
					
						
							|  |  |  |   info: 'green', | 
					
						
							|  |  |  |   data: 'grey', | 
					
						
							|  |  |  |   help: 'cyan', | 
					
						
							|  |  |  |   warn: 'yellow', | 
					
						
							|  |  |  |   debug: 'blue', | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  |   error: 'red', | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // outputs red text
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('this is an error'.error); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | // outputs yellow text
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('this is a warning'.warn); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | // outputs grey text
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('this is an input'.input); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | console.log('Generic logging theme as file'.green.bold.underline); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Load a theme from file
 | 
					
						
							| 
									
										
										
										
											2017-09-29 15:49:30 -07:00
										 |  |  | try { | 
					
						
							|  |  |  |   colors.setTheme(require(__dirname + '/../themes/generic-logging.js')); | 
					
						
							|  |  |  | } catch (err) { | 
					
						
							|  |  |  |   console.log(err); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | // outputs red text
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('this is an error'.error); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | // outputs yellow text
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('this is a warning'.warn); | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | // outputs grey text
 | 
					
						
							| 
									
										
										
										
											2018-04-30 14:59:34 -07:00
										 |  |  | console.log('this is an input'.input); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // console.log("Don't summon".zalgo)
 | 
					
						
							| 
									
										
										
										
											2014-09-30 22:41:24 +02:00
										 |  |  | 
 |