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

gach

v1.7.5

Published

This is a package to colorize your terminal text messages.

Readme

Gach - ANSI Text Styling Library

Gach is a JavaScript and TypeScript library for styling and coloring text using ANSI escape codes. It allows you to easily apply various text styles and colors to your console output.

Installation

You can install Gach via npm:

npm install gach

Usage

To use Gach, import it into your JavaScript or TypeScript file and create an instance with the text you want to style.

import gach from 'gach';

const styledText = gach('Hello, World!')
    .color('red')
    .bgColor('blue')
    .bold()
    .underline()
    .text;

console.log(styledText);

This will output the text "Hello, World!" styled with red text on a blue background, bold, and underlined effect.

Features

  • Pre-defined system font & background colors (red, green, blue, yellow, cyan, magenta, gray, black, and their light variants).
  • Font color using rgb and hex values.
  • Support for predefined color names (e.g., COLOR_NAMES).
  • Font styles (bold, italic, underline, strikethrough, inverse).
  • Custom styles can be applied using an object for more flexibility.
  • Nested functions for chaining styles.
  • Reset function to revert text to its original state.
  • Error handling for invalid color inputs (if applicable).

More Examples

You can use this package like this in both Javascript and Typescript:

import gach, { COLOR_NAMES } from 'gach'

const log = console.log
// 1. Empty text test:
log(`<<< ${gach('').color('magenta').bold().text} >>> <-- Warning: Received an Empty String!`);

// 2. Text styled with Light Blue color:
log(`<<< ${gach('Text styled with LIGHT BLUE').color(COLOR_NAMES.LIGHT_BLUE).text} >>>`);

// 3. Text with a red background and bold style:
log(`<<< ${gach('Important message with a red background').bgColor(COLOR_NAMES.RED).bold().text} >>>`);

// 4. Custom RGB color [118, 38, 113]:
log(`<<< ${gach('Text styled with custom RGB color [118, 38, 113]').rgb(118, 38, 113).text} >>>`);

// 5. Styled with HEX color code #FF7733:
log(`<<< ${gach('Styled with HEX color code #FF7733').hex('#FF7733').text} >>>`);

// 6. Bold, underline, and green text:
log(`<<< ${gach('Emphasized with bold, underline, and green text').underline().bold().color('green').text} >>>`);

// 7. Reset text formatting to normal:
log(`<<< ${gach('Reset text formatting to normal').underline().bold().color(COLOR_NAMES.RED).reset().text} >>>`);

// 8. Styled with red text and yellow background:
log(`<<< ${gach('Styled with red text and yellow background').bgColor(COLOR_NAMES.LIGHT_YELLOW).color(COLOR_NAMES.RED).bold().underline().text} >>>`);

// 9. Success message (green, bold):
log(`<<< ${gach('Success message: Operation successful').success().text} >>>`);

// 10. Error message (red, bold, underlined):
log(`<<< ${gach('Error message: Something went wrong!').error().text} >>>`);

// 11. Warning message (yellow, bold, italic):
log(`<<< ${gach('Warning message: Be cautious!').warning().text} >>>`);

// 12. Rainbow effect (multicolored text):
log(`<<< ${gach('Rainbow effect: Colorful Text!').rainbow().text} >>>`);

// 13. Custom styled message with specific colors, background, and strikethrough:
log(`<<< ${gach('This is a custom styled message').customStyle({ color: COLOR_NAMES.MAGENTA, bgColor: COLOR_NAMES.LIGHT_BLUE, strikethrough: true }).text} >>>`);

The result will be like below:

Output: alt text

Supported Colors & Styles

Colors

Supported colors for both font and background are:

  • red
  • green
  • blue
  • yellow
  • cyan
  • magenta
  • gray
  • black
  • lightRed
  • lightGreen
  • lightYellow
  • lightBlue
  • lightMagenta
  • lightCyan

Styles

Supported styles are:

  • bold
  • italic
  • underline
  • strikethrough
  • inverse