1.1.6 • Published 3 years ago
ez-cli-color v1.1.6
ez-cli-color
Colorful Text Formatting
This code provides a utility for formatting text with different colors and styles in a terminal or console.
Usage
Install the necessary dependencies:
npm install ez-cli-colorImport the ez object to access the available formatting options:
const ez = require("ez-cli-color");- Format your text using the available options:
Replace with one of the available color options, such as black, red, green, etc. You can also specify additional formatting options by providing an options object.const formattedText = ez.<color>(text, options); // for text color const formattedText = ez.background.<color>(text, options); // for background colorconst formattedText = ez.red("Hello, world!", { bold: true });
Available Colors
blackredgreenyellowbluemagentacyanwhite
Available Options
The options object accepts the following properties:
underline(boolean): Set to true to underline the text. Default: false.bold(boolean): Set to true to make the text bold. Default: false.
Examples
Format text with different colors and options:
const ez = require("./path/to/ez");
const formattedText1 = ez.red("Error occurred!", { bold: true });
console.log(formattedText1);
const formattedText2 = ez.yellow("Warning: Invalid input", { underline: true });
console.log(formattedText2);License
This code is licensed under the MIT License. See the LICENSE file for more information.