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

encolor

v1.0.29

Published

Encolor is a collection of colorization functions that add ANSI color codes to terminal output. It includes pre-defined color functions for black, red, green, yellow, blue, magenta, and cyan, as well as utility functions to create custom colors through he

Downloads

30

Readme

Encolor

Encolor is a collection of functions that add ANSI color codes to terminal output, making it easier to colorize text. ANSI color codes are a set of escape codes that allow you to change the color and formatting of text in a terminal. By adding these codes to your output, you can highlight important information, distinguish between different types of messages, and make your console output more visually appealing.

Encolor currently includes 7 pre-defined color functions and the ability to define custom colors through hex and rgb values. It is written in TypeScript with type definitions for ease of use.

Installation

You can install Encolor using npm:

npm install encolor

Usage

Here's an example of how to use Encolor:

const { encolor } = require("encolor");

console.log(encolor.black("This text will be black!"));
console.log(encolor.red("This text will be red!"));
console.log(encolor.green("This text will be green!"));
console.log(encolor.yellow("This text will be yellow!"));
console.log(encolor.blue("This text will be blue!"));
console.log(encolor.magenta("This text will be magenta!"));
console.log(encolor.cyan("This text will be cyan!"));
console.log(encolor.hex("This text will be orange-red!", "#FF6E15")); // Custom color through hex value
console.log(encolor.rgb("This text will be spring green!", { r: 0, g: 255, b: 127 })); // Custom color through rgb value

An example of Encolor working in a terminal

Features

Encolor provides the following features:

  • Pre-defined color functions for black, red, green, yellow, blue, magenta, and cyan
  • Custom color functions through hex and rgb values
  • Written in TypeScript with type definitions for ease of use

Contributing

If you'd like to contribute to Encolor, please follow these guidelines:

  1. Fork the project
  2. Create a new branch (git checkout -b new-feature)
  3. Make your changes and commit them (git commit -am 'Added a new feature')
  4. Push your changes to your fork (git push origin new-feature)
  5. Open a pull request

Issues

If you encounter any issues with Encolor, please create a new issue on the GitHub repository.