Socket
Book a DemoInstallSign in
Socket

color-line

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-line

make command more beautiful

1.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

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 : basic

#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 :basic

//---------------addStyle------------------
colorLine.addStyle('inverse')
.addStyle('bold');
console.log(colorLine.getColorText()+'\r\n');

will print :addStyle

//---------------removeStyle------------------
colorLine.removeStyle('underline');
console.log(colorLine.getColorText()+'\r\n');

will print :removeStyle

//---------------clearStyle------------------
colorLine.clearStyle();
console.log(colorLine.getColorText()+'\r\n');

will print :clearStyle

//---------------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 :bright

//---------------removeForeColor------------------
colorLine.removeForeColor();
console.log(colorLine.getColorText()+'\r\n');

will print :removeForeColor

//---------------removeBackColor------------------
colorLine.removeBackColor();
console.log(colorLine.getColorText()+'\r\n');

will print :removeBackColor

//---------------clearColor------------------
colorLine.setText('redWithYellow')
.setForeColor('red') 
.setBackColor('yellow');
console.log(colorLine.getColorText()+'\r\n');
colorLine.clearColor();
console.log(colorLine.getColorText()+'\r\n');

will print : clearColor

//---------------empty Text------------------
colorLine.setText('      ')
.setBackColor('yellow');
console.log(colorLine.getColorText()+'\r\n');

will print : emptyText

//---------------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

Keywords

command

FAQs

Package last updated on 22 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.