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 🙏

© 2025 – Pkg Stats / Ryan Hefner

console-colorizer-adnan

v1.0.3

Published

A simple npm package to colorize console logs

Readme

Console Colorizer

A simple and lightweight npm package to add beautiful colors to your console output. Make your terminal logs more readable and visually appealing with easy-to-use color functions.

🎨 Features

  • Simple API - Easy to use color functions
  • Lightweight - Minimal dependencies, fast performance
  • ANSI Colors - Standard terminal color support
  • Shortcut Loggers - Direct console logging with colors
  • Node.js Compatible - Works in any Node.js environment

📦 Installation

npm install console-colorizer-adnan

🚀 Quick Start

const { colorize, log } = require('console-colorizer-adnan');

// Colorize any text
console.log(colorize("This is red text", "red"));
console.log(colorize("This is green text", "green"));

// Use shortcut loggers
log.red("Error: Something went wrong!");
log.green("Success: Operation completed!");
log.yellow("Warning: Check your inputs!");

📚 API Reference

colorize(text, color)

Colorizes the given text with the specified color.

Parameters:

  • text (string) - The text to colorize
  • color (string) - The color name (see available colors below)

Returns: (string) - The colorized text

Example:

const { colorize } = require('console-colorizer-adnan');

const message = colorize("Hello World!", "blue");
console.log(message);

log Object

Provides shortcut methods for direct console logging with colors.

Available Methods:

  • log.red(message)
  • log.green(message)
  • log.yellow(message)
  • log.blue(message)
  • log.magenta(message)
  • log.cyan(message)
  • log.white(message)

Example:

const { log } = require('console-colorizer-adnan');

log.red("This is a red error message");
log.green("This is a green success message");
log.yellow("This is a yellow warning message");

🎨 Available Colors

| Color | Description | |-------|-------------| | red | Red text | | green | Green text | | yellow | Yellow text | | blue | Blue text | | magenta | Magenta text | | cyan | Cyan text | | white | White text |

💡 Usage Examples

Basic Usage

const { colorize, log } = require('console-colorizer-adnan');

// Colorize individual strings
console.log(colorize("Processing...", "yellow"));
console.log(colorize("✓ Completed", "green"));

// Use shortcut loggers
log.blue("Starting application...");
log.green("✓ Server started successfully!");
log.red("✗ Database connection failed");

Error Handling

const { log } = require('console-colorizer-adnan');

try {
  // Some operation
  throw new Error("Something went wrong");
} catch (error) {
  log.red(`Error: ${error.message}`);
}

Status Messages

const { log } = require('console-colorizer-adnan');

function processData(data) {
  log.cyan("Processing data...");
  
  if (data.length === 0) {
    log.yellow("Warning: No data to process");
    return;
  }
  
  // Process data
  log.green(`Successfully processed ${data.length} items`);
}

🔧 Development

Running Tests

node test.js

Project Structure

console-colorizer/
├── index.js      # Main package file
├── test.js       # Test examples
├── package.json  # Package configuration
└── README.md     # This file

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the ISC License.

🔗 Links

⭐ Support

If you find this package helpful, please consider giving it a star on GitHub!


Made with ❤️ by Adnan