npm install stream-mdxIn production, host the worker bundle from static assets (avoid blob: CSP requirements):
mkdir -p public/workers
cp node_modules/@stream-mdx/worker/dist/hosted/markdown-worker.js public/workers/markdown-worker.jsIf you want to reuse the worker + patch stream in a terminal UI (Ink, etc.), use the Node worker helper:
stream-mdx/worker/node(or@stream-mdx/worker/node)
Start with docs/TUI_GUIDE.md for the recommended architecture and package choices, then use docs/CLI_USAGE.md for the lower-level worker/message examples.
StreamingMarkdown is a client component.
"use client";
import { StreamingMarkdown } from "stream-mdx";
export function Demo({ text }: { text: string }) {
return <StreamingMarkdown text={text} worker="/workers/markdown-worker.js" />;
}import { StreamingMarkdown } from "stream-mdx";
export default function App() {
return <StreamingMarkdown text="## Hello\n\nStreaming **markdown**" worker="/workers/markdown-worker.js" />;
}- Props/types:
docs/PUBLIC_API.md - MDX + customization:
docs/REACT_INTEGRATION_GUIDE.md - Plugin/worker cookbook:
docs/STREAMING_MARKDOWN_PLUGINS_COOKBOOK.md