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

@measured/calibrate-markdown

v0.2.0

Published

Opinionated GFM markdown → safe HTML utility. Pairs with Calibrate's prose component.

Readme

@measured/calibrate-markdown

Opinionated GFM markdown → safe HTML utility. Pairs with Calibrate's prose component.

Install

pnpm add @measured/calibrate-markdown

Usage

Two named exports cover full-document and inline rendering.

import {
  processMarkdown,
  processMarkdownInline,
} from "@measured/calibrate-markdown";

const html = processMarkdown("# Hello\n\nMarkdown **rocks**.");
const inline = processMarkdownInline("a **bold** label");

Both return an HTML string.

Features

  • GFM extensions: tables, strikethrough, autolinks, footnotes
  • Heading id slugs (for in-page anchor links)
  • Inline color chip swatches for color literals (#ff69b4, hotpink, …)
  • Syntax highlighting on fenced code blocks (highlight.js class names)
  • Defensive sanitization (XSS hardening on the output HTML)

processMarkdownInline is for rendering markdown inside a single block-level HTML element (e.g. <p>, <figcaption>) where nested block elements would produce invalid HTML. The output is restricted to a small set of inline tags; headings, paragraphs, lists, and code blocks are stripped.

Sanitization

The pipeline runs rehype-sanitize over the output. The default schema permits:

  • highlight.js classes on <code> and <span>
  • color-chip class and inline style for color swatches
  • Standard GFM elements

Sanitization is a defensive default. The package assumes markdown source is trusted (authored, agent-generated, or reviewed) but still scrubs the output to harden against XSS in the rare case untrusted markdown reaches the renderer. Adversarial input (CMS user content, comment systems, third-party feeds) requires its own input controls upstream — the sanitize layer here is a safety net, not a primary line of defence.

Extension

The sanitize schemas are exported so consumers building custom unified pipelines, or layering their own transforms, can extend them without re-deriving the same allowances:

import {
  sanitizeSchema,
  sanitizeInlineSchema,
} from "@measured/calibrate-markdown";

Pairing with @measured/calibrate-core's prose component

The HTML this package emits uses GFM's element set. Calibrate's prose component (shipped with @measured/calibrate-core) styles the same set, so the output drops in directly:

import { renderClbrProse } from "@measured/calibrate-core";
import { processMarkdown } from "@measured/calibrate-markdown";

const html = renderClbrProse({
  children: processMarkdown(markdown),
});