1.10.4 • Published 4 years ago

ctext v1.10.4

Weekly downloads
6
License
ISC
Repository
github
Last release
4 years ago

Colored Text in Console

Node.js Package

Small library (zero dependency) to display colored text in the console.

Basic Usage

  1. Initialize
const ctext = require('ctext');

const ymu = new ctext({
  color: 'yellow', // or ctext.colors.yellow
  bgColor: 'magenta', // or ctext.bgColors.magenta
  format: 'underscore' // or ctext.format.underscore
});
  1. Use
console.log(ymu.text('Hello World'));

Code and output samples

const ctext = require('ctext');

// text with no styling
const dText = new ctext();

// text with black color and white background
const bw = new ctext({
  color: 'black', 
  bgColor: 'white'
});

// parameters can be passed using colors, bgColors, and format attributes
const ymu = new ctext({
  color: ctext.colors.yellow,
  bgColor: ctext.bgColors.magenta,
  format: ctext.format.underscore
});

const y = new ctext({
  color: ctext.colors.yellow
});

const dr = new ctext({
  bgColor: ctext.bgColors.red
});

console.log(dText.text('Hello World'));
console.log(bw.text('Hello World'));
console.log(ymu.text('Hello World'));
console.log(y.text('Hello World'));
console.log(dr.text('Hello World'));

ctext Object input options

color: StringbgColor: Stringformat: String
blackblackreset
redredbright
greengreendim
yellowyellowunderscore
blueblueblink
magentamagentareverse
cyancyanhidden
whitewhite

Output

Output

Contribution

For contribution details please refer this document.

1.10.4

4 years ago

1.10.3

4 years ago

1.10.2

4 years ago

1.10.1

4 years ago

1.0.6

4 years ago

1.10.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago