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 🙏

© 2024 – Pkg Stats / Ryan Hefner

color-my-log

v2.0.0

Published

Lightweight and easy-to-use npm package for adding colorful terminal messages in Node.js effortlessly.

Downloads

17

Readme

color-my-log (WIP)

LOWERCASE BACKGROUND COLOURS && TYPES ADDED NOTE: This package is currently a work in progress (WIP). It provides a simple way to print colored log messages with background colors in Node.js applications. Additional features and options may be added in future releases.

color-my-log is a lightweight npm package that enables you to print colored log messages in Node.js applications. It currently supports customizing the background color of log messages.

Installation

You can install color-my-log using npm:

npm install color-my-log

Usage

To use color-my-log in your Node.js application, first, require the package and create an instance of the Log class:

JS

const { log } = require("color-my-log");

ES6

import { log } from "color-my-log";

Coming soon

Printing Colored Log Messages

The color-my-log package provides methods to print log messages with different foreground colors and customizable background colors. You can use the following methods to print log messages with different foreground colors and a specified background color:

log.red(message, options);
log.black(message, options);
log.green(message, options);
log.yellow(message, options);
log.blue(message, options);
log.magenta(message, options);
log.cyan(message, options);
log.white(message, options);

image

Parameters:

  • message (string): The log message that you want to print.
  • options (optional object): An optional object to customize the log appearance.
    • background (string): Specify the background color for the log message. Valid values are 'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', and 'white'.

Example:

log.red("Error occurred!", { background: "yellow" });
log.blue("Info message", { background: "green" });

Available Colors

The following are the available foreground colors that you can use with the color-my-log package:

  • red
  • black
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

Customization

The package is currently under development, and more features and customization options may be added in future releases. The package uses ANSI escape codes for color formatting, and you can easily extend it with your own color choices.

If you have any suggestions or feature requests, feel free to submit them to [GitHub repository link].

License

This package is open-source and distributed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.

Author

color-my-log was created by Mark Tyree. You can reach me at [email protected].