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

@deltakit/markdown

v0.2.0

Published

Stream markdown in AI chat without flicker or broken syntax

Readme

@deltakit/markdown

Streaming markdown renderer for AI chat UIs. Parses and renders markdown incrementally so completed blocks never re-render and partial syntax never flickers on screen. Zero dependencies beyond React.

Installation

npm install @deltakit/markdown

Requires React 18+.

Quick Start

import { StreamingMarkdown } from "@deltakit/markdown";

function AssistantMessage({ content }: { content: string }) {
  return <StreamingMarkdown content={content} isStreaming={true} />;
}

With useStreamChat from @deltakit/react:

import { useStreamChat } from "@deltakit/react";
import { StreamingMarkdown } from "@deltakit/markdown";

function Chat() {
  const { messages, isLoading, sendMessage } = useStreamChat({
    api: "/api/chat",
  });

  return (
    <div>
      {messages.map((msg) => (
        <div key={msg.id}>
          {msg.parts
            .filter((p) => p.type === "text")
            .map((p, i) => (
              <StreamingMarkdown
                key={i}
                content={p.text}
                isStreaming={isLoading}
              />
            ))}
        </div>
      ))}
    </div>
  );
}

API

<StreamingMarkdown />

The main component. Pass markdown text and a streaming flag.

<StreamingMarkdown
  content={text}           // Markdown string
  isStreaming={true}        // true while content is arriving
  batchMs={8}              // Debounce interval in ms (default: 0)
  components={{            // Override any rendered element
    h1: ({ children }) => <h1 className="title">{children}</h1>,
    code_block: ({ language, code }) => (
      <SyntaxHighlighter language={language}>{code}</SyntaxHighlighter>
    ),
  }}
/>

Completed blocks are memoized with React.memo -- they never re-render as new content streams in.

useStreamingMarkdown(options)

The underlying hook, for full control over rendering.

import { useStreamingMarkdown } from "@deltakit/markdown";

function CustomRenderer({ content, isStreaming }) {
  const { blocks, buffered } = useStreamingMarkdown({
    content,
    isStreaming,
    batchMs: 8,
  });

  return (
    <div>
      {blocks.map((block, i) => (
        <BlockRenderer key={i} block={block} />
      ))}
    </div>
  );
}

parseIncremental(content) (framework-agnostic)

The core parser, importable without React:

import { parseIncremental } from "@deltakit/markdown/core";

const result = parseIncremental("# Hello\n\nSome **bold** text");
// result.blocks  -- completed blocks
// result.active  -- block still being typed
// result.buffer  -- incomplete syntax held back

Supported Syntax

| Syntax | Element | |--------|---------| | # heading | h1 -- h6 | | **bold** | strong | | *italic* | em | | `code` | inline code | | ~~strike~~ | strikethrough | | [text](url) | link | | ![alt](src) | image | | <url> | autolink | | ``` fenced blocks | code block | | - item / * item | unordered list | | 1. item | ordered list | | > quote | blockquote | | --- | horizontal rule | | blank line | paragraph break |

Streaming Behavior

  • Completed blocks render immediately and are memoized
  • Active block re-renders as new characters arrive
  • Code blocks show as empty skeleton <pre><code> shells until the closing fence arrives
  • Incomplete syntax (e.g. unclosed **) is buffered and hidden until resolved
  • batchMs debounces updates to reduce render frequency during fast streams

Bundle Size

12.0 KB minified / 3.8 KB gzipped. Zero runtime dependencies.

Documentation

Full documentation, guides, and examples at deltakit.dev.

License

MIT