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

@oakoliver/glamour

v1.0.1

Published

Stylesheet-based markdown rendering for the terminal — a pure TypeScript port of charmbracelet/glamour

Downloads

212

Readme

@oakoliver/glamour

Stylesheet-based markdown rendering for the terminal. A pure TypeScript port of charmbracelet/glamour with zero dependencies (except the optional @oakoliver/lipgloss peer dependency for table rendering).

Features

  • Render markdown as styled ANSI terminal output
  • 7 built-in themes: dark, light, ascii, dracula, tokyo-night, pink, notty
  • Custom GFM markdown parser (no external dependencies)
  • OSC 8 hyperlink support
  • Full GFM support: tables, task lists, strikethrough, fenced code blocks
  • Word-wrapping with CJK wide character support
  • Works on Node.js, Bun, and Deno

Install

npm install @oakoliver/glamour

Quick Start

import { render, renderWithTheme } from '@oakoliver/glamour';

// Render with the default dark theme
const output = render('# Hello World\n\nThis is **bold** and *italic* text.');
console.log(output);

// Render with a specific theme
const light = renderWithTheme('# Hello\n\nParagraph text.', 'light');
console.log(light);

Themes

Built-in themes: dark, light, ascii, dracula, tokyo-night, pink, notty.

import { renderWithTheme } from '@oakoliver/glamour';

const out = renderWithTheme('# Dracula Theme\n\n> A blockquote', 'dracula');

Advanced Usage

Use TermRenderer for full control over rendering options:

import { TermRenderer, withStandardStyle, withWordWrap } from '@oakoliver/glamour';

const renderer = new TermRenderer(
  withStandardStyle('dark'),
  withWordWrap(100),
);

const output = renderer.render('# Custom Rendering\n\nWith word wrap at 100 columns.');
console.log(output);

Custom Styles

Pass a StyleConfig object to fully customize how each markdown element is rendered:

import { TermRenderer, withStyles } from '@oakoliver/glamour';
import type { StyleConfig } from '@oakoliver/glamour';

const myStyle: Partial<StyleConfig> = {
  heading: { bold: true, color: '#ff6600', prefix: '>>> ' },
  paragraph: { margin: 1 },
  code: { prefix: '`', suffix: '`', color: '#00ff00' },
};

const renderer = new TermRenderer(withStyles(myStyle));
const output = renderer.render('# Orange Heading\n\nCustom styling.');

API

Top-level Functions

  • render(markdown: string, options?: RenderOption[]): string — Render markdown with the default dark theme.
  • renderWithTheme(markdown: string, theme: string): string — Render with a named built-in theme.

TermRenderer

  • new TermRenderer(...options: RenderOption[]) — Create a renderer with options.
  • renderer.render(markdown: string): string — Render markdown to styled ANSI text.
  • renderer.renderBytes(markdown: string): Uint8Array — Render to bytes.

Option Functions

  • withStandardStyle(name: string) — Use a built-in theme by name.
  • withStyles(styles: Partial<StyleConfig>) — Custom style config.
  • withWordWrap(width: number) — Set word-wrap width (default: 80).
  • withPreservedNewLines() — Preserve newlines in paragraphs.
  • withBaseURL(url: string) — Resolve relative URLs against a base.
  • withEmoji() — Enable emoji shortcode expansion.

Parser

The custom GFM parser is also exported for direct use:

import { parse, NodeKind } from '@oakoliver/glamour';

const ast = parse('# Hello\n\nWorld');
// Walk the AST...

Attribution

This is a TypeScript port of glamour by Charmbracelet, Inc., licensed under MIT.

License

MIT