New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@aibind/markdown

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aibind/markdown

Streaming markdown renderer for AI chat — framework-agnostic core with Svelte/Vue/Solid components

latest
Source
npmnpm
Version
0.8.0
Version published
Maintainers
1
Created
Source

@aibind/markdown

Standalone streaming markdown parser and renderer. Framework-agnostic core with zero runtime dependencies. Solves the "Flash of Incomplete Markdown" (FOIM) problem — unterminated bold, partial code blocks, and split links render gracefully during AI streaming.

Features

  • O(n) incremental parsing — only new/active blocks are parsed
  • Markdown recovery — closes unterminated syntax so partial output renders cleanly
  • Pluggable renderer — bring your own renderer, core never touches the DOM
  • Zero dependencies — core parser + HTML renderer in ~16 KB (< 3 KB brotli)
  • XSS-safe — HTML entities escaped by default

Install

npm install @aibind/markdown

Usage

import { StreamParser, HtmlRenderer, MarkdownRecovery } from "@aibind/markdown";

const renderer = new HtmlRenderer();
const parser = new StreamParser(renderer);

parser.write("# Hello\n\nThis is **bold** text.\n\n```js\nconst x = 1;\n```");
parser.end();

renderer.html; // full HTML string

With markdown recovery (for in-progress streams)

const text = "# Title\n\nSome **bold text that is not yet";
const recovered = MarkdownRecovery.recover(text);

const renderer = new HtmlRenderer();
const parser = new StreamParser(renderer);
parser.write(recovered);
parser.end();
renderer.html; // clean HTML with closed tags

Framework Components

Each framework package provides a reactive component/hook:

PackageImportUsage
@aibind/svelte/markdownStreamMarkdown<StreamMarkdown text={stream.text} streaming={stream.loading} />
@aibind/vue/markdownStreamMarkdown<StreamMarkdown :text="text" :streaming="loading" />
@aibind/solid/markdownuseStreamMarkdownconst html = useStreamMarkdown(() => text(), () => streaming())
@aibind/react/markdownStreamMarkdown<StreamMarkdown text={text} streaming={loading} />

Documentation

Full documentation: aibind.dev

License

MIT

Keywords

markdown

FAQs

Package last updated on 09 Mar 2026

Related posts