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

stream-mdx

v0.1.1

Published

StreamMDX convenience package (re-exports @stream-mdx/*).

Downloads

689

Readme

stream-mdx

High-performance streaming Markdown/MDX renderer for React with a worker-first pipeline, incremental patching, and backpressure guardrails.

This is the convenience package:

  • stream-mdx re-exports the main React API from @stream-mdx/react
  • stream-mdx/{core,react,worker,plugins} proxy to the scoped packages
  • stream-mdx/plugins/* proxies the common plugin entrypoints (helpful for pnpm users)

If you want maximum modularity (or you’re publishing your own library), install the scoped packages directly. Otherwise, start here.

Install

npm install stream-mdx

Quickstart

1) Copy the hosted worker bundle

In production you should host the worker bundle from static assets (stricter CSP, no blob:).

After installing, copy the worker into your app:

mkdir -p public/workers
cp node_modules/@stream-mdx/worker/dist/hosted/markdown-worker.js public/workers/markdown-worker.js

Next.js (App Router)

StreamingMarkdown is a client component. Import it behind a "use client" boundary.

"use client";

import { StreamingMarkdown } from "stream-mdx";

export function Demo({ text }: { text: string }) {
  return (
    <StreamingMarkdown
      text={text}
      worker="/workers/markdown-worker.js"
      features={{ html: true, tables: true, math: true, mdx: true }}
      mdxCompileMode="worker"
    />
  );
}

If you import StreamingMarkdown from a server component, you’ll typically see useRef is not a function. Fix by moving the import behind a "use client" boundary.

Vite React

import { StreamingMarkdown } from "stream-mdx";

export default function App() {
  return (
    <StreamingMarkdown
      text="## Hello\n\nStreaming **markdown**"
      worker="/workers/markdown-worker.js"
      features={{ html: true, tables: true, math: true }}
    />
  );
}

Configuration at a glance

  • text / stream: provide a full string or an append-only AsyncIterable<string>.
  • worker: a Worker, URL, URL string, or factory; defaults to the built-in worker strategy and falls back to /workers/markdown-worker.js.
  • features: { html?, tables?, mdx?, math?, footnotes?, callouts? }.
  • mdxCompileMode: "worker" (no server) or "server" (requires an endpoint; see docs).
  • components / inlineComponents: override block + inline renders (wrap code/math without losing incremental rendering).
  • tableElements: override table tags (e.g. Shadcn table wrappers).
  • htmlElements: override HTML tag renders (when HTML is enabled).
  • mdxComponents: MDX component registry (when MDX compilation is enabled).
  • scheduling: patch scheduler/backpressure knobs.

Plugins

Common entrypoints (convenience package):

  • stream-mdx/plugins/document
  • stream-mdx/plugins/tables
  • stream-mdx/plugins/html
  • stream-mdx/plugins/math
  • stream-mdx/plugins/mdx

Scoped equivalents:

  • @stream-mdx/plugins/document (etc)

Addons

  • @stream-mdx/mermaid (optional Mermaid diagram renderer)

Example:

import { StreamingMarkdown } from "stream-mdx";
import { MermaidBlock } from "@stream-mdx/mermaid";

<StreamingMarkdown text={content} components={{ mermaid: MermaidBlock }} />;

Docs

  • Docs site: https://kmccleary3301.github.io/stream-mdx/
  • Manual: docs/COMPREHENSIVE_PROJECT_DOCUMENTATION.md
  • API: docs/PUBLIC_API.md
  • React integration: docs/REACT_INTEGRATION_GUIDE.md
  • Plugins cookbook: docs/STREAMING_MARKDOWN_PLUGINS_COOKBOOK.md
  • Status/architecture notes: docs/STREAMING_MARKDOWN_V2_STATUS.md
  • Release checklist: docs/STREAMING_MARKDOWN_RELEASE_CHECKLIST.md

Package map

  • stream-mdx – React surface (@stream-mdx/react)
  • stream-mdx/react – React renderer + types
  • stream-mdx/worker – worker client + default worker helpers
  • stream-mdx/plugins – plugin registry + helpers
  • stream-mdx/plugins/* – common plugin entrypoints
  • stream-mdx/core – structured-clone-safe types + perf utilities