color-line
v1.0.1
Published
make command more beautiful
Downloads
4
Readme
color-line
make command more beautiful
#use color-line
npm install color-line
#Basic Use
const ColorLine = require('color-line');
let colorLine = new ColorLine();
colorLine.setText('redWithBlue')
.setForeColor('red')
.setBackColor('blue')
.addStyle('underline')
console.log(colorLine.getColorText()+'\r\n');
will print :
#more Example
const ColorLine = require('color-line');
let colorLine = new ColorLine();
//---------------Basic USE------------------
colorLine.setText('redWithBlue')
.setForeColor('red')
.setBackColor('blue')
.addStyle('underline')
console.log(colorLine.getColorText()+'\r\n');
will print :
//---------------addStyle------------------
colorLine.addStyle('inverse')
.addStyle('bold');
console.log(colorLine.getColorText()+'\r\n');
will print :
//---------------removeStyle------------------
colorLine.removeStyle('underline');
console.log(colorLine.getColorText()+'\r\n');
will print :
//---------------clearStyle------------------
colorLine.clearStyle();
console.log(colorLine.getColorText()+'\r\n');
will print :
//---------------open bright------------------
//It looks more bright
colorLine.setText('redWithYellowANdBright')
.setForeColor('red',true) //open bright
.setBackColor('yellow',true); //open bright
console.log(colorLine.getColorText()+'\r\n');
will print :
//---------------removeForeColor------------------
colorLine.removeForeColor();
console.log(colorLine.getColorText()+'\r\n');
will print :
//---------------removeBackColor------------------
colorLine.removeBackColor();
console.log(colorLine.getColorText()+'\r\n');
will print :
//---------------clearColor------------------
colorLine.setText('redWithYellow')
.setForeColor('red')
.setBackColor('yellow');
console.log(colorLine.getColorText()+'\r\n');
colorLine.clearColor();
console.log(colorLine.getColorText()+'\r\n');
will print :
//---------------empty Text------------------
colorLine.setText(' ')
.setBackColor('yellow');
console.log(colorLine.getColorText()+'\r\n');
will print :
//---------------INIT------------------
colorLine.setText('blue')
.setForeColor('blue');
console.log(colorLine.getColorText()+'\r\n');
colorLine.init();//all clear
console.log(colorLine.getColorText()+'\r\n');
Nothing output,because clear all
Styles
- bold
- dim
- italic
- underline
- inverse
- hidden
- strikethrough
Color
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white