Sha256: 8ebc54e2c345bf1a6084f51aad90035e4e066f9c46fdcc757fd84430602f3fa1

Contents?: true

Size: 1.96 KB

Versions: 36

Compression:

Stored size: 1.96 KB

Contents

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);

// eslint-disable-next-line max-len
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)

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
rapid_stack-0.2.0 templates/frontend/node_modules/@colors/colors/examples/normal-usage.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/@colors/colors/examples/normal-usage.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.60 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.59 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.58 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.57 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.56 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.55 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.54 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.53 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.52 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.51 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.50 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.49 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.48 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.47 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.46 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.45 node_modules/@colors/colors/examples/normal-usage.js
immosquare-cleaner-0.1.44 node_modules/@colors/colors/examples/normal-usage.js