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

@rao123dk/console-color

v1.0.8

Published

change console output colors

Downloads

38

Readme

console-color

console-color is a lightweight, dependency-free JavaScript library that allows you to easily add colors to your console output based on user preferences. With a size of less than 4KB, it's perfect for enhancing the readability of your CLI applications without adding bloat.

green

green

green

green

Features

  • No Dependencies: console-color is completely standalone.
  • Tiny Size: Less than 4KB.
  • Easy to Use: Simple and intuitive API for adding colors to console output.
  • Customizable: Support for various colors to match user preferences.

install

npm i @rao123dk/console-color

yarn add @rao123dk/console-color

setup

Require the Library in Your Entry File In your index.js file, require your @rao123dk/console-color library:

require(`@rao123dk/console-color`)

use

console.log.red('red color');

red

console.log.green('green color');

green

console.log.green.bold('Success: Operation completed successfully.');

green

console.log.yellow('yellow color');

yellow

console.log.blue('blue color');
console.log.magenta('magenta color');
console.log.cyan('cyan color');
console.log.white('white color');

Example

console.log.red('Error: Something went wrong!');
console.log.green('Success: Operation completed successfully.');
console.log.blue('Info: Please check the details below.');
console.log.yellow('Warning: Please be cautious.');
console.log.cyan('Debug: Variable value is undefined.');
console.log.magenta('Notice: This is an important notice.');
console.log.white('General: This is a general message.');

console.log.blue.italic('Info: Please check the details below.');
console.log.yellow.underline('Warning: Please be cautious.');
console.log.white.background('General: This is a general message.');

Contributing

We welcome contributions! If you'd like to contribute, please fork the repository and submit a pull request.

License

@rao123dk/console-color is licensed under the MIT License. See the LICENSE file for more details.