
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@aibind/markdown
Advanced tools
Streaming markdown renderer for AI chat — framework-agnostic core with Svelte/Vue/Solid components
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.
🚀 O(n) incremental parsing — Block-level: only new blocks are parsed. Inline-level: only the active block is re-rendered. Never re-parses completed blocks.
🩹 Markdown recovery — Detects and closes unterminated syntax (unclosed bold, code blocks, links, etc.) so partial output always renders cleanly.
🔌 Renderer interface — 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. Safe for innerHTML / {@html}.
npm install @aibind/markdown
import { StreamParser, HtmlRenderer, MarkdownRecovery } from '@aibind/markdown';
const renderer = new HtmlRenderer();
const parser = new StreamParser(renderer);
// Feed chunks as they arrive from AI stream
parser.write('# Hello\n\nThis is **bold');
parser.write('** and more text.\n\n```js\nconst x = 1;\n```');
parser.end();
renderer.html; // full HTML string
const text = '# Title\n\nSome **bold text that is not yet';
const recovered = MarkdownRecovery.recover(text);
// → '# Title\n\nSome **bold text that is not yet**'
const renderer = new HtmlRenderer();
const parser = new StreamParser(renderer);
parser.write(recovered);
parser.end();
renderer.html; // clean HTML with closed tags
StreamParserIncremental streaming markdown parser. Feed chunks of markdown text and it emits tokens to the attached renderer.
const parser = new StreamParser(renderer);
parser.write(chunk); // feed a chunk of markdown
parser.end(); // flush remaining content
HtmlRendererBuilt-in renderer that produces an HTML string from parser tokens.
const renderer = new HtmlRenderer();
// ... use with StreamParser ...
renderer.html; // accumulated HTML string
renderer.reset(); // clear and start over
MarkdownRecoveryStatic utility that detects and closes unterminated markdown syntax.
MarkdownRecovery.recover(text); // returns text with closed delimiters
Handles: unclosed code fences, bold (**), italic (*), strikethrough (~~), inline code (`).
Renderer (abstract)Base class for custom renderers. Implement these methods:
class MyRenderer extends Renderer {
open(token: Token): void { } // element opened (heading, paragraph, etc.)
close(token: Token): void { } // element closed
text(content: string): void { } // text content
attr(key: string, value: string): void { } // attribute (href, src, etc.)
}
)inline code***bold italic***)[text](url) and images Each framework package re-exports the core and provides a reactive component/hook:
| Package | Import | Component |
|---|---|---|
@aibind/svelte/markdown | StreamMarkdown | <StreamMarkdown text={stream.text} streaming={stream.loading} /> |
@aibind/sveltekit/markdown | StreamMarkdown | Same as svelte |
@aibind/vue/markdown | StreamMarkdown | <StreamMarkdown :text="text" :streaming="loading" /> |
@aibind/nuxt/markdown | StreamMarkdown | Same as vue |
@aibind/solid/markdown | useStreamMarkdown | const html = useStreamMarkdown(() => text(), () => streaming()) |
@aibind/solidstart/markdown | useStreamMarkdown | Same as solid |
MIT
FAQs
Streaming markdown renderer for AI chat — framework-agnostic core with Svelte/Vue/Solid components
The npm package @aibind/markdown receives a total of 30 weekly downloads. As such, @aibind/markdown popularity was classified as not popular.
We found that @aibind/markdown demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.