1.0.9 • Published 5 months ago

@mlgq/color-print v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

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.

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago