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

ansilory

v2.0.2

Published

Terminal styling made beautiful

Readme

Ansilory

Terminal styling made beautiful

npm npm downloads

Installation

# npm
npm install ansilory

# yarn
yarn add ansilory

# pnpm
pnpm add ansilory

# bun
bun add ansilory

ANSI Escape Codes

Ansilory includes robust support for ANSI escape codes, enabling vibrant and expressive CLI output. It supports 4-bit, 8-bit, and 24-bit color modes, with a chainable syntax for easy styling.

ANSI Features

  • Chainable Syntax: Combine styles fluently (e.g., ansi.red.bold.underline('Hello')).
  • Fully Typed: TypeScript support for all ANSI styles.
  • Comprehensive SGR Codes: Includes all Select Graphic Rendition (SGR) codes.
  • Cross-Platform: Works in Node.js, Deno, and ANSI-compatible browser terminals.
  • Auto-Reset: Automatically appends \x1b[0m to reset styles after each print.
  • Raw Output: Use .apply(text) to retrieve styled strings without printing.

ANSI Usage

import { o } from 'ansilory';

// Basic styling
o.bold('Bold text'); // Bold text
o.italic.underline('Stylish!'); // Italicized and underlined text
o.red.bgWhite.bold('Alert!'); // Red text on white background, bold
console.log(o.green.apply('Green text')); // Returns raw styled string

Supported ANSI Styles

| Category | Styles | | --------------- | ------------------------------------------------------------------------------------------------------------------------------ | | Text Styles | bold, dim, italic, underline, blink, inverse, hidden | | Foreground | black, red, green, yellow, blue, magenta, cyan, white | | Bright FG | gray, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite | | Background | bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite | | Bright BG | bgGray, bgBrightRed, bgBrightGreen, bgBrightYellow, bgBrightBlue, bgBrightMagenta, bgBrightCyan, bgBrightWhite | | Reset | .reset (or automatic after every print) |

ANSI Examples

o.inverse('Inverted'); // Inverted text
o.brightCyan('Bright Cyan Text'); // Bright cyan text
o.bgBrightMagenta.white.bold('Highlight this!'); // White bold text on bright magenta background

How ANSI Works

Ansilory’s ANSI support uses dynamic proxy chaining to build escape sequences. Each chained property appends an ANSI code, and the final invocation wraps the text with the appropriate codes:

o.red.bold('Hello'); // Outputs: \u001b[31m\u001b[1mHello\u001b[0m

[!NOTE] Use .apply(text) to retrieve the raw styled string for further processing without printing to the console.