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

bare-tui-markdown

v0.0.1

Published

A limited markdown renderer for bare-tui

Readme

bare-tui-markdown

A limited markdown → ANSI renderer for bare-tui.

[!NOTE] This is an experimental library. A version 1.0.0 release will signal stability.

Models (and humans) reply in markdown; a bare-tui transcript shows plain, width-wrapped lines. This package bridges the two — it renders a deliberately limited subset of markdown into styled, width-correct terminal rows, and degrades gracefully on anything it doesn't model rather than erroring. It builds entirely on bare-tui's style (the only source of ANSI, and the ANSI-aware width measurement that word-wrap needs).

const md = require('bare-tui-markdown')

const lines = md.renderLines('Run **keet** with:\n\n- `--mode terminal`\n- `--dev`', { width: 60 })
for (const line of lines) console.log('  ' + line) // indent into your own transcript

What it supports

bold (** / __), italic (* / _), inline code (`), headings (####), unordered and ordered lists, fenced code blocks (```), blockquotes (>), horizontal rules (---), and links [text](url) (rendered as styled text, url hidden). Paragraphs reflow to the given width — a single newline is a soft wrap, a blank line separates paragraphs, two trailing spaces force a hard break.

Out of scope (rendered as plain/flat text): nested lists, tables, images, reference-style links, HTML, task lists.

API

md.render(text, { width = 80, theme })      // → string  (lines joined with '\n')
md.renderLines(text, { width = 80, theme }) // → string[]  (one styled row per line) — primary
md.defaultTheme                              // the theme, to spread/extend
md.mergeTheme(partial)                       // → a full theme over the defaults

renderLines is the primary entry for a TUI that owns its own scrollback (it indents each row itself). width is the content width you have available; the renderer never returns a row wider than it (except an unbreakable word or a code line, which overflow rather than split).

Theme

A small bag of block style functions, inline colour attributes the renderer composes per word, and literal markers — shallow-merged over the defaults:

md.render(text, { theme: { bullet: '* ', inline: { codeFg: 'magenta' } } })

Security

Input is treated as untrusted (it's often LLM- or peer-authored). It's sanitized of terminal-control bytes — every C0/C1/DEL byte except newline and tab, so a raw ESC/CSI can never reach the terminal — before parsing, and the renderer emits ANSI only through style().render(). A \x1b[31m-style payload in the input is stripped to inert text.

License

Apache-2.0