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

@myuym/term-style

v1.0.1

Published

Terminal fancy output library with chainable API - colors, styles, boxes, progress bars, spinners, and tables

Readme

@myuym/term-style

Terminal fancy output library with chainable API. Make your CLI output colorful and beautiful.

Installation

npm install @myuym/term-style

Quick Start

import t from '@myuym/term-style';

// Simple colors
t.red('Red text');
t.green('Green text');
t.blue.log('Blue text printed directly'); // .log() prints to console

// Chain styles
t.bold.red('Bold red text');
t.italic.underline.cyan('Italic underlined cyan');
t.bgYellow.black.bold('Yellow background, black text, bold');

API

Colors

Foreground colors:

  • black, red, green, yellow, blue, magenta, cyan, white
  • brightBlack / gray / grey, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite

Background colors (with bg prefix):

  • bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite
  • bgBrightBlack / bgGray, bgBrightRed, bgBrightGreen, etc.
t.red('Red foreground')
t.bgBlue('Blue background')
t.bgYellow.blue('Yellow background with blue text')

Styles

  • bold - Bold text
  • dim - Dimmed text
  • italic - Italic text
  • underline - Underlined text
  • blink - Blinking text
  • inverse - Swapped foreground/background
  • hidden - Hidden text
  • strikethrough - Strikethrough text
t.bold('Bold text')
t.bold.italic.underline.red('Multiple styles')

RGB / HEX Colors

t.rgb(255, 100, 50)('Custom RGB color')
t.hex('#FF6432')('HEX color')
t.bgRgb(0, 100, 200).white('RGB background')
t.bgHex('#0064C8')('HEX background')

Log Shortcuts

Pre-formatted log methods with icons:

t.success('Operation completed!') // ✓ Green
t.error('Something went wrong')   // ✗ Red
t.warn('Warning message')         // ⚠ Yellow
t.info('Information')             // ℹ Blue
t.debug('Debug details')          // ⚙ Gray

Box Output

Create bordered boxes for important content:

// Simple box
t.box('Simple content')

// Styled box
t.box({
  title: 'Important',
  borderColor: 'cyan',
  borderStyle: 'double',
  padding: 1
}, 'This is the content\nMultiple lines supported')

Box options:

  • title - Optional title shown in top border
  • borderColor - Color name (red, green, cyan, etc.)
  • borderStyle - single | double | round | bold | none
  • padding - Internal padding (default: 0)
  • margin - External margin (default: 0)
  • width - Fixed width

Progress Bar

const bar = t.progress.start({ total: 100 });

for (let i = 0; i <= 100; i++) {
  bar.update(i);
  await sleep(50);
}

bar.complete();

Progress options:

  • total - Total value (default: 100)
  • width - Bar width in characters (default: 40)
  • complete - Character for completed portion (default: █)
  • incomplete - Character for incomplete portion (default: ░)

Spinner

const spinner = t.spinner.start('Loading...');

// Do some work
await doSomething();

spinner.succeed('Done!');
// Or: spinner.fail('Failed')
// Or: spinner.warn('Warning')
// Or: spinner.info('Info')

Table Output

t.table.render([
  { name: 'Alice', age: 28, city: 'Beijing' },
  { name: 'Bob', age: 32, city: 'Shanghai' },
  { name: 'Carol', age: 25, city: 'Guangzhou' }
], {
  headers: ['Name', 'Age', 'City'],
  borderColor: 'green'
});

Table options:

  • headers - Custom header labels
  • borderColor - Border color name
  • padding - Cell padding (default: 1)
  • columns - Column definitions with key, header, width, align

Utilities

// Strip ANSI codes from a string
const plain = t.strip('\x1b[31mRed\x1b[0m'); // 'Red'

// Check color support
console.log(t.supportsColor); // true/false
console.log(t.colorLevel);    // 0, 1, 2, or 3

Color levels:

  • 0 - No color support
  • 1 - 16 colors
  • 2 - 256 colors
  • 3 - True color (24-bit RGB)

Examples

import t from '@myuym/term-style';

// Header
t.cyan.bold('═══════════════════════════════════════');
t.cyan.bold('  Welcome to My CLI Tool');
t.cyan.bold('═══════════════════════════════════════');
console.log();

// Status messages
t.success('Dependencies installed');
t.warn('Some packages are outdated');
t.error('Build failed');
t.info('See docs for more info');
console.log();

// Box with info
t.box({
  title: 'Configuration',
  borderColor: 'yellow',
  borderStyle: 'round',
  padding: 1
}, 'Environment: production\nDebug: false\nPort: 3000');
console.log();

// Table
t.table.render([
  { file: 'index.ts', size: '2.3 KB', status: 'changed' },
  { file: 'utils.ts', size: '1.1 KB', status: 'unchanged' },
  { file: 'config.json', size: '456 B', status: 'new' }
], {
  headers: ['File', 'Size', 'Status'],
  borderColor: 'cyan'
});

TypeScript

Full TypeScript support with exported types:

import t, { BoxOptions, TableOptions, ProgressBar, Spinner } from 'term-style';

License

MIT