New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

textcolorizer

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

textcolorizer

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

TextColorizer

npm version License

A simple package for adding colored text to the console log. Currently working only on React Projects.

Installation

Install the package using npm:

npm install textcolorizer

Usage

Import the Log class from the textcolorizer package and use its methods to add colored text to the console log.

import { Log } from 'textcolorizer'


function App() {

  useEffect(()=>{

// Success message in green color
Log.success('Operation successful.');

// Error message in red color
Log.danger('An error occurred.');

// Information message with black text on yellow background
Log.info('Please note the following information.');

// Customised color message 1st parameter is the mesg 2nd parameter is the font color and 3rd is the background color
Log.customColor("Custom message","blue","grey");

// Make the font weight bold
Log.bold("The font is now bold");

// Italic font 
Log.italic("The font is now Italic");

  },[])

  return (
    <div className="App">

      <h1>Welcome to  TextColorizer</h1>
      
    </div>
  );
}

The Log class provides the following methods:

  • success(msg: string): Displays the msg parameter in green color.
  • danger(msg: string): Displays the msg parameter in red color.
  • info(msg: string): Displays the msg parameter with black text on a yellow background.

Feel free to customize the colors and styles in the Log class according to your preferences.

Contributing

Contributions are welcome! If you encounter any issues or would like to suggest improvements, please submit a pull request or create an issue on the GitHub repository.

Keywords

color text

FAQs

Package last updated on 23 Jun 2023

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