summaryrefslogtreecommitdiff
path: root/node_modules/colors/examples
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-21 16:50:49 +0100
committerMinteck <contact@minteck.org>2021-12-21 16:50:49 +0100
commit20204baf1807825af4798ad03bfb329e4da05bc5 (patch)
tree1568515fa1e4592206ed5d2327b39e6b443cbd03 /node_modules/colors/examples
downloadbingoloto-remote-20204baf1807825af4798ad03bfb329e4da05bc5.tar.gz
bingoloto-remote-20204baf1807825af4798ad03bfb329e4da05bc5.tar.bz2
bingoloto-remote-20204baf1807825af4798ad03bfb329e4da05bc5.zip
Commit
Diffstat (limited to 'node_modules/colors/examples')
-rw-r--r--node_modules/colors/examples/normal-usage.js82
-rw-r--r--node_modules/colors/examples/safe-string.js79
2 files changed, 161 insertions, 0 deletions
diff --git a/node_modules/colors/examples/normal-usage.js b/node_modules/colors/examples/normal-usage.js
new file mode 100644
index 0000000..822db1c
--- /dev/null
+++ b/node_modules/colors/examples/normal-usage.js
@@ -0,0 +1,82 @@
+var colors = require('../lib/index');
+
+console.log('First some yellow text'.yellow);
+
+console.log('Underline that text'.yellow.underline);
+
+console.log('Make it bold and red'.red.bold);
+
+console.log(('Double Raindows All Day Long').rainbow);
+
+console.log('Drop the bass'.trap);
+
+console.log('DROP THE RAINBOW BASS'.trap.rainbow);
+
+// styles not widely supported
+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);
+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('Background color attack!'.black.bgWhite);
+console.log('Use random styles on everything!'.random);
+console.log('America, Heck Yeah!'.america);
+
+console.log('Blindingly '.brightCyan + 'bright? '.brightRed + 'Why '.brightYellow + 'not?!'.brightGreen);
+
+console.log('Setting themes is useful');
+
+//
+// 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',
+ error: 'red',
+});
+
+// outputs red text
+console.log('this is an error'.error);
+
+// outputs yellow text
+console.log('this is a warning'.warn);
+
+// outputs grey text
+console.log('this is an input'.input);
+
+console.log('Generic logging theme as file'.green.bold.underline);
+
+// Load a theme from file
+try {
+ colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));
+} catch (err) {
+ console.log(err);
+}
+
+// outputs red text
+console.log('this is an error'.error);
+
+// outputs yellow text
+console.log('this is a warning'.warn);
+
+// outputs grey text
+console.log('this is an input'.input);
+
+// console.log("Don't summon".zalgo)
+
diff --git a/node_modules/colors/examples/safe-string.js b/node_modules/colors/examples/safe-string.js
new file mode 100644
index 0000000..5bc0168
--- /dev/null
+++ b/node_modules/colors/examples/safe-string.js
@@ -0,0 +1,79 @@
+var colors = require('../safe');
+
+console.log(colors.yellow('First some yellow text'));
+
+console.log(colors.yellow.underline('Underline that text'));
+
+console.log(colors.red.bold('Make it bold and red'));
+
+console.log(colors.rainbow('Double Raindows All Day Long'));
+
+console.log(colors.trap('Drop the bass'));
+
+console.log(colors.rainbow(colors.trap('DROP THE RAINBOW BASS')));
+
+// 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.zebra('Zebras are so 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.america('America, Heck Yeah!'));
+
+console.log(colors.brightCyan('Blindingly ') + colors.brightRed('bright? ') + colors.brightYellow('Why ') + colors.brightGreen('not?!'));
+
+console.log('Setting themes is useful');
+
+//
+// Custom themes
+//
+// console.log('Generic logging theme as JSON'.green.bold.underline);
+// Load theme with JSON literal
+colors.setTheme({
+ silly: 'rainbow',
+ input: 'blue',
+ verbose: 'cyan',
+ prompt: 'grey',
+ info: 'green',
+ data: 'grey',
+ help: 'cyan',
+ warn: 'yellow',
+ debug: 'blue',
+ error: 'red',
+});
+
+// outputs red text
+console.log(colors.error('this is an error'));
+
+// outputs yellow text
+console.log(colors.warn('this is a warning'));
+
+// outputs blue text
+console.log(colors.input('this is an input'));
+
+
+// console.log('Generic logging theme as file'.green.bold.underline);
+
+// Load a theme from file
+colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));
+
+// outputs red text
+console.log(colors.error('this is an error'));
+
+// outputs yellow text
+console.log(colors.warn('this is a warning'));
+
+// outputs grey text
+console.log(colors.input('this is an input'));
+
+// console.log(colors.zalgo("Don't summon him"))
+
+