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

dyejs

v1.0.2

Published

A lightweight and flexible terminal string styling library for Node.js and TypeScript. Supports colors, gradients (foreground/background), custom themes, and colorized logging.

Readme

dyejs

A lightweight and flexible JavaScript/TypeScript library for terminal string styling, gradients, and themes. dyejs makes it easy to add color, style, and effects to your CLI output with a simple and intuitive API.

Features

Supported Colors

Basic Foreground Colors

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

Bright Foreground Colors

  • blackBright
  • redBright
  • greenBright
  • yellowBright
  • blueBright
  • magentaBright
  • cyanBright
  • whiteBright

Aliases

  • gray
  • grey

Background Colors

  • bgBlack
  • bgRed
  • bgGreen
  • bgYellow
  • bgBlue
  • bgMagenta
  • bgCyan
  • bgWhite

Bright Background Colors

  • bgBlackBright
  • bgRedBright
  • bgGreenBright
  • bgYellowBright
  • bgBlueBright
  • bgMagentaBright
  • bgCyanBright
  • bgWhiteBright

Background Aliases

  • bgGray
  • bgGrey

Gradients

You can use any of the above color names or hex codes (e.g., #ff0000, #00ff00, #0000ff) for gradients. Use gradient, gradientFg, or gradientBg to apply gradients to text.

Installation

npm install dyejs

Usage

Using Icons & Emojis

You can include Unicode emojis and icons directly in your strings:

console.log(dye("✅ Success!", "green"));
console.log(dye("⚠️ Warning!", "yellow"));
console.log(dye("❌ Error!", "red"));
console.log(rainbow("🌈 Rainbow!"));
console.log(blink("🚨 Blinking Alert!"));
await typewriter("⌛ Loading...");

Animated Effects

Add animation and dynamic effects to your terminal output:

import { rainbowAnimate, blinkAnimate, typewriter } from "dyejs";

// Animated rainbow text
await rainbowAnimate("Animated Rainbow!");

// Simulated blinking text
await blinkAnimate("Simulated Blinking!");

// Typewriter effect
await typewriter("Loading...");

Basic Dyeing

import { dye } from "dyejs";
console.log(dye("Hello, World!", "red"));

Using Gradients

import { gradient } from "dyejs";
console.log(gradient("Gradient Text", ["red", "yellow", "green"]));

Gradients with Hex Codes

You can use hex color codes for more precise gradients:

import { gradientFg, gradientBg } from "dyejs";
console.log(gradientFg("Hex Gradient", ["#ff0000", "#00ff00", "#0000ff"])); // Foreground gradient
console.log(
  gradientBg("Background Hex Gradient", ["#ff0000", "#00ff00", "#0000ff"])
); // Background gradient

Both gradientFg and gradientBg accept arrays of named colors or hex codes.

Theming

import { dye, themes } from "dyejs";
themes.defineTheme("error", (msg) => dye.red(msg));
themes.defineTheme("info", (msg) => dye.blue(msg));
themes.defineTheme("success", (msg) => dye.green(msg));
console.log(dye("This is an error", "error"));

Logger

import { logger } from "dyejs";
logger.info("Information message");
logger.error("Error message");
logger.success("Success message");

API Reference

rainbowAnimate(text, options?)

  • text (string): The text to animate with a moving rainbow effect.
  • options (object): Optional. { delay?: number, repeat?: number } for speed and cycles.

blinkAnimate(text, options?)

  • text (string): The text to animate with a blinking effect.
  • options (object): Optional. { delay?: number, repeat?: number } for speed and cycles.

typewriter(text, delay?)

  • text (string): The text to animate as a typewriter.
  • delay (number): Optional. Delay in ms between characters (default: 50).

dye(text, color)

  • text (string): The text to dye (colorize).
  • color (string): The color or theme key to apply.

gradient(text, colors)

  • text (string): The text to apply the gradient to.
  • colors (string[]): Array of color names for the gradient.

themes.defineTheme(name, fn)

  • name (string): Theme key.
  • fn (function): Function that returns a styled string.

logger

  • logger.info(message)
  • logger.error(message)
  • logger.success(message)

Animated Effects

import { rainbowAnimate, blinkAnimate, typewriter } from "dyejs";

// Animated rainbow text
await rainbowAnimate("Animated Rainbow!");

// Simulated blinking text
await blinkAnimate("Simulated Blinking!");

// Typewriter effect
await typewriter("Loading...");

License

MIT

  • Terminal string styling with colors and styles
  • Foreground and background gradients (named and hex colors)
  • Custom color themes
  • Colorized logger (info, error, success)
  • Animated effects: rainbow, blinking, and typewriter (simulated in all terminals)
  • TypeScript support