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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-stream-markdown

v0.3.0

Published

Streaming markdown output, Useful for text streams like LLM outputs.

Readme

vue-stream-markdown

npm version License

A markdown renderer specially optimized for streaming scenarios, inspired by streamdown. Designed to achieve smoother streaming rendering through syntax inference and highly customizable rendering elements.

pnpm add vue-stream-markdown

Features

  • Streaming-optimized rendering - Incomplete node completion with loading states for images, tables, and code blocks to prevent visual jitter
  • Incremental rendering - Leverages Shiki's codeToTokens API for token-level updates, reducing DOM recreation overhead
  • Progressive Mermaid rendering - Throttled, streaming-friendly diagram rendering with loading states
  • Streaming LaTeX rendering - Progressive math equation rendering with KaTeX support
  • Interactive controls - Copy and download buttons for images, tables, and code blocks
  • Fully customizable - Replace any AST node with your own Vue components
  • Theme-aware scoped styles - Scoped styles under .stream-markdown with semantic data-stream-markdown attributes, following shadcn/ui design system
  • Beautiful built-in typography - No atomic CSS required (Tailwind/UnoCSS), self-contained styles
  • Content hardening & security - Built-in protection against malicious Markdown with URL validation and protocol blocking
  • SSR support - Full server-side rendering compatibility with environment detection utilities

Usage

[!IMPORTANT] 🚧 vue-stream-markdown is currently in active feature development.

Breaking changes are avoided as much as possible, but the project maintains a relatively high release frequency.

If a version meets your needs, you don't need to always follow the latest version.

For detailed usage and API documentation, please refer to the Documentation.

<script setup lang="ts">
import { ref } from 'vue'
import { Markdown } from 'vue-stream-markdown'
import 'vue-stream-markdown/index.css'
// If you don't have shadcn CSS variables globally, import the theme
import 'vue-stream-markdown/theme.css'

const content = ref('# Hello World\n\nThis is a markdown content.')
</script>

<template>
  <Markdown :content="content" />
</template>

Credit

This project is inspired by streamdown and even uses some source code from it.

This project also uses and benefits from:

  • mdast - Markdown Abstract Syntax Tree format
  • Shiki - Beautiful syntax highlighting
  • Mermaid - Diagramming and charting tool
  • KaTeX - Fast math typesetting library for the web
  • Remend - This project implements similar functionality inspired by remend for intelligently parsing and completing incomplete Markdown blocks.

Code Sources

  • markstream-vue - The original inspiration for learning AST-based custom markdown rendering, and the source of the animation implementation used in this project
  • ast-explorer - Learned AST knowledge from this project, and the playground layout inspiration and AST syntax tree filtering code are derived from it
  • medium-zoom - Inspired the custom image zoom implementation
  • markdown-sanitizers - URL validation and security hardening logic in src/utils/harden.ts is ported from rehype-harden
  • Dify - LaTeX preprocessing logic in src/preprocess/vendored/markdown-utils.ts is ported from Dify

Acknowledgments

I would like to express my sincere gratitude to those who provided guidance and support during the project selection phase and promotion phase of this project. Without their encouragement and support, I would not have been able to complete this work. In particular, the streamdown community provided excellent code guidance and even helped fix several issues.

Troubleshooting

The playground supports generating shareable links and provides streaming controls (forward/backward navigation) for debugging streaming rendering issues.

If you encounter any problems, please:

  1. Use the Generate Share Links button in the playground to create a shareable link with your current content
  2. Enable the AST Result toggle to view the parsed AST syntax tree
  3. Copy the markdown content and AST syntax tree at the time of the issue

Please provide the shareable link, markdown content, and AST syntax tree when creating an issue. This will help me reproduce and diagnose the problem more effectively.

Contributors

Contributors

License

MIT License © jinghaihan