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

termfont

v0.1.2

Published

Block-based text art generator for terminal and SVG.

Readme

Install

npm install termfont

Or run directly with npx:

npx termfont "Hello" --color=cyan

Examples

Solid colors

npx termfont "Hello" --font=sans --color=white
npx termfont "ARCADE" --font=block --color=lime
npx termfont "Quiz.ai" --font=block --color=gold
npx termfont "hack" --font=block --color=lime

Gradients

npx termfont "sunset" --font=bold --gradient=orange,pink,purple
npx termfont "NEON" --font=block --gradient=purple,cyan,lime
npx termfont "fire" --font=block --gradient=red,yellow
npx termfont "ice" --font=block --gradient=white,cyan,blue

Rainbow

npx termfont "rainbow" --font=bold --rainbow

Per-word colors

npx termfont "open|code" --font=block --color=cyan,gray

Use | as a zero-width color separator (no space between words). Use commas to assign colors to words.

Effects

npx termfont "RETRO" --font=block --color=coral --shadow
npx termfont "outline" --font=bold --color=cyan --outline

Fonts

npx termfont "Hello" --font=sans
npx termfont "GOLD" --font=serif --color=gold
npx termfont "slim" --font=slim --color=pink
npx termfont "NARROW" --font=narrow --color=violet
npx termfont "ARCADE" --font=block --color=lime

| Font | Style | Width | |------|-------|-------| | sans | Clean default | 5px | | serif | Decorative serifs | 5px | | slim | Thin strokes | 5px | | bold | Heavy weight | 6px | | narrow | Condensed | 3px | | block | Chunky geometric | 7px |

Sizes

Terminal output supports three sizes:

# Small - compact half-block rendering
npx termfont "Hello" --size=sm

# Medium (default) - full block characters
npx termfont "Hello" --size=md

# Large - double-width, double-height blocks
npx termfont "Hello" --size=lg

SVG output

SVGs render as flat pixel art on a transparent background, ready to use on websites. Same-color pixels are merged into single <path> elements for minimal file size.

# Save to file
npx termfont "Logo" --svg --color=cyan --out=logo.svg

# Custom pixel size
npx termfont "Big" --svg --font=block --color=gold --size-px=24 --out=big.svg

# Gradient SVG
npx termfont "Neon" --svg --font=block --gradient=purple,cyan --out=neon.svg

CLI

termfont <text> [options]

Options:
  --color=<color>       Text color (name or hex, default: white)
                        Use commas for per-word colors (e.g. cyan,gray)
  --gradient=<a,b>      Gradient from color A to B (e.g. red,yellow)
                        Supports 3-stop: --gradient=red,yellow,green
  --rainbow             Rainbow color mode
  --font=<name>         Font: sans (default), serif, slim, bold, narrow, block
  --size=<size>         Size: sm, md (default), lg
  --compact             Half-block mode (sm is always compact)
  --shadow              Add drop shadow
  --shadow-color=<c>    Shadow color (default: gray)
  --outline             Add outline around text
  --border              Add pixel-art border frame
  --padding=<n>         Padding around text (default: 1)
  --svg                 Output SVG instead of terminal
  --size-px=<n>         SVG pixel size (default: 16)
  --out=<file>          Write output to file
  -h, --help            Show this help

API

import {
  composeText,
  renderTerminal,
  renderSVG,
  applyPadding,
  applyShadow,
  computeOutline,
  parseColor,
} from "termfont";

Terminal output

import { composeText, renderTerminal, applyPadding } from "termfont";

const grid = composeText("Hello", { font: "block" });
const padded = applyPadding(grid, 1);

const lines = renderTerminal(padded, {
  colorMode: { type: "solid", color: [0, 220, 220] },
});
console.log(lines.join("\n"));

SVG output

import { composeText, renderSVG } from "termfont";

const grid = composeText("Hello", { font: "block" });
const svg = renderSVG(grid, {
  colorMode: { type: "rainbow" },
  pixelSize: 16,
});
// svg is a string ready to write to a file or embed in HTML

Gradients

import { composeText, renderTerminal, applyPadding } from "termfont";

const grid = composeText("Fire", { font: "block" });
const padded = applyPadding(grid, 1);

const lines = renderTerminal(padded, {
  colorMode: {
    type: "gradient",
    from: [255, 0, 0],
    to: [255, 255, 0],
    direction: "horizontal",
  },
});
console.log(lines.join("\n"));

3-stop gradient

const lines = renderTerminal(padded, {
  colorMode: {
    type: "gradient",
    from: [128, 0, 255],
    via: [0, 220, 220],
    to: [50, 255, 50],
    direction: "horizontal",
  },
});

Shadow

import { composeText, renderTerminal, applyPadding, applyShadow } from "termfont";

let grid = composeText("Shadow", { font: "block" });
grid = applyPadding(grid, 1);
const { grid: shadowed, shadowMask } = applyShadow(grid, 1, 1);

const lines = renderTerminal(shadowed, {
  colorMode: { type: "solid", color: [255, 100, 80] },
  shadowMask,
  shadowColor: [80, 80, 80],
});
console.log(lines.join("\n"));

Outline

import { composeText, renderTerminal, applyPadding, computeOutline } from "termfont";

let grid = composeText("Outline", { font: "bold" });
grid = applyPadding(grid, 1);
const outlineMask = computeOutline(grid);

const lines = renderTerminal(grid, {
  colorMode: { type: "solid", color: [0, 220, 220] },
  outlineMask,
});
console.log(lines.join("\n"));

Per-word colors

import { composeText, renderTerminal, applyPadding, getWordBoundaries, parseColor } from "termfont";

const text = "open|code";
const fontName = "block";
const grid = composeText(text.replace(/\|/g, ""), { font: fontName });
const padded = applyPadding(grid, 1);
const boundaries = getWordBoundaries(text, { font: fontName });

const lines = renderTerminal(padded, {
  colorMode: {
    type: "segments",
    segments: [
      { endX: boundaries[0] + 1, mode: { type: "solid", color: parseColor("cyan") } },
      { endX: Infinity, mode: { type: "solid", color: parseColor("gray") } },
    ],
  },
});
console.log(lines.join("\n"));

Compact mode

const lines = renderTerminal(padded, {
  colorMode: { type: "solid", color: [255, 255, 255] },
  compact: true, // half-block rendering, half the height
});

Color modes

// Solid
{ type: "solid", color: [255, 0, 0] }

// Gradient (2 or 3 stops)
{ type: "gradient", from: [255, 0, 0], to: [255, 255, 0], direction: "horizontal" }
{ type: "gradient", from: [255, 0, 0], via: [255, 255, 0], to: [0, 255, 0], direction: "horizontal" }

// Rainbow
{ type: "rainbow" }

// Per-segment
{ type: "segments", segments: [
  { endX: 20, mode: { type: "solid", color: [0, 220, 220] } },
  { endX: Infinity, mode: { type: "solid", color: [128, 128, 128] } },
]}

Named colors

white black red green blue yellow cyan magenta orange pink purple lime teal navy gold gray coral violet silver darkgray lightgray

License

MIT