@mlgq/color-print
v1.0.9
Published
a package to printing colorful text in the terminal
Downloads
7
Readme
color-print
This lightweight package is very convenient to print colorful text in the terminal.
Install
npm install @cellent/color-print
yarn add @cellent/color-print
Usage
Well, it can not be any simpler to use, there are some examples:
const print = require("@cellent/color-print")
// This is a red text
print.red("...")
// This is a text with red background
print.redBg("...")
There are a total of 16 methods available: black | red | green | blue | yellow | purple | cyan | white (Bg?)
If you want to combine font color and background color, you can use pass the second optional param, the parameter value is also one of the above names, and has a string type.
// This ia a red text with white background
print.red("...", "white")
//This is a yellow text with black background
print.blackBg("...", "yellow")
As you see, the method without Bg
accepts the second param which represent the background color, and the method
with BG
accepts the second param which describe the font color.
Each printing will be end with line break by default, if you want an inline printing
, you can pass the third
paramter as false.