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

@libretimes/markdown

v0.3.0

Published

Markdown rendering pipeline for academic publishing: KaTeX, syntax highlighting, LaTeX-style statement blocks.

Readme

@libretimes/markdown

Markdown rendering pipeline for academic publishing: KaTeX, syntax highlighting (shiki), and LaTeX-style statement blocks, assembled as a set of remark/rehype plugins on top of unified.

Install

npm install @libretimes/markdown

Peer dependencies: react (>=19) and unified (>=10).

Import the stylesheet once in your app:

import "@libretimes/markdown/styles.css";
import "katex/dist/katex.min.css";

Rendering

The pipeline is asynchronous: the default rehype set includes rehype-pretty-code, whose shiki highlighter is async. So rendering can't go through react-markdown (it evaluates the tree with runSync). There are two entry points.

MarkdownRenderer (Server Component)

An async React Server Component. Use it on server-rendered pages, such as publication pages.

import { MarkdownRenderer } from "@libretimes/markdown";

export default function Page({ body }: { body: string }) {
  return <MarkdownRenderer content={body} language="en" />;
}

| Prop | Type | Default | |---|---|---| | content | string | required | | language | Language (en/ru/fr/de/zh) | "en" | | className | string | "prose dark:prose-invert max-w-none" |

The default className expects Tailwind Typography (prose). Override it for bare-element styling.

renderMarkdown (anywhere)

The async core: markdown in, sanitized HTML out. Use it when you can't render an async server component -- for example a client-side live preview, where you call it inside an effect and inject the result.

"use client";
import { useEffect, useState } from "react";
import { renderMarkdown } from "@libretimes/markdown";

function Preview({ body }: { body: string }) {
  const [html, setHtml] = useState("");
  useEffect(() => {
    let cancelled = false;
    renderMarkdown(body, { language: "en" }).then((out) => {
      if (!cancelled) setHtml(out);
    });
    return () => { cancelled = true; };
  }, [body]);

  return (
    <div
      className="prose dark:prose-invert max-w-none"
      dangerouslySetInnerHTML={{ __html: html }}
    />
  );
}

The output is sanitized by rehype-sanitize inside the pipeline, so it's safe to inject.

Plugin access

For a custom pipeline, the building blocks are exported individually: getMarkdownPlugins, getRemarkPlugins, getRehypePlugins, sanitizeSchema, the individual plugins, and the statement registry/labels. See src/index.ts.

Design

Why rendering is async, why it returns HTML instead of a React tree, and when to change that: docs/rendering.md.