npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@joelmo/console-color

v1.0.3

Published

Modern console styling with ANSI codes and HEX colors

Downloads

13

Readme

🎨 ConsoleColor

  • Style your terminal with elegance and HEX colors
  • ConsoleColor is a modern library for coloring and styling terminal output with ANSI, HEX, and RGB codes.
  • It offers a lightweight, expressive, and chainable API for Node.js.

npm version npm downloads license

🚀 Installation

Open your command prompt and paste the following command:

 npm i @joelmo/console-color

⚡ Basic Usage

import cc from "@joelmo/console-color";

// Simple colored text
cc().log('red', 'Red text!');

// Multiple styles
cc().log(['bgYellow', 'blue', 'bold'], 'Blue text on yellow background');

// HEX color (text)
cc().hex('#FF00FF', 'Magenta text');

// HEX color (background + bold)
cc().hex('#00FFCC', 'Text with turquoise background', { bg: true, bold: true });

// Direct ANSI styling
console.log(cc().style('underline', 'cyan') + 'Underlined cyan text' + '\x1b[0m');

🧩 API Reference

cc().log(styles, text)

  • Prints text with one or more combined styles.
cc().log(['bgRed', 'red', 'bold'], '[ERROR] Critical Error!');

cc().style(...styles)

  • Returns only the ANSI style sequence (does not print).
  • Useful for custom formatting and composition.
console.log(cc().style('bold', 'underline', 'cyan') + 'Custom text' + '\x1b[0m');

cc().hex(hex, text, options)

  • Applies a custom HEX or RGB color dynamically.

| Parameter | Type | Description | | -------------- | --------- | ----------------------------------- | | hex | string | Color in #RRGGBB or #RGB format | | text | string | The text to display | | options.bg | boolean | Apply as background color | | options.bold | boolean | Apply bold style |

Examples:

cc().hex('#FFAA00', 'Orange text');
cc().hex('#00FF00', 'Green text with background', { bg: true, bold: true });

💅 Available Styles

🎨 Text Colors

| Name | Description | | -------------- | -------------- | | black | Black | | red | Red | | green | Green | | yellow | Yellow | | blue | Blue | | magenta | Magenta | | cyan | Cyan | | white | White | | gray | Gray | | lightRed | Bright red | | lightGreen | Bright green | | lightYellow | Bright yellow | | lightBlue | Bright blue | | lightMagenta | Bright magenta | | lightCyan | Bright cyan | | lightWhite | Bright white |

🖼️ Background Colors

| Name | Description | | ---------------- | ------------------------ | | bgBlack | Black background | | bgRed | Red background | | bgGreen | Green background | | bgYellow | Yellow background | | bgBlue | Blue background | | bgMagenta | Magenta background | | bgCyan | Cyan background | | bgWhite | White background | | bgGray | Gray background | | bgLightRed | Light red background | | bgLightGreen | Light green background | | bgLightYellow | Light yellow background | | bgLightBlue | Light blue background | | bgLightMagenta | Light magenta background | | bgLightCyan | Light cyan background | | bgLightWhite | Bright white background |

✨ Text Formatting Styles

| Name | Effect | | --------------- | ----------------- | | bold | Bold text | | dim | Faint text | | italic | Italic text | | underline | Underlined text | | reverse | Inverted colors | | strikethrough | ~~Strikethrough~~ |

🌈 Custom HEX / RGB Colors

Supports any valid HEX color:

cc().hex("#ff0000", "Red");
cc().hex("#00ff00", "Green");
cc().hex("#0099ff", "Light Blue");
cc().hex("#ff00ff", "Magenta");
cc().hex("#222222", "Dark Gray", { bg: true });

🔧 Advanced Usage

You can manually build styles using .style():

const { style } = cc();

console.log(style('bold', 'bgCyan', 'black') + 'Custom styled text' + '\x1b[0m');

Or predefine reusable patterns:

const warning = cc().style('bgYellow', 'black', 'bold');
console.log(`${warning}WARNING!${cc().style('reset')}`);

🧾 License

MIT License © Joelmo

💬 Feedback

⭐ Star the repo on GitHub

🐛 Found a bug? Open an issue

💡 Have an idea? Contributions and pull requests are welcome!