{"id":28306,"library":"streaming-markdown","title":"streaming-markdown","description":"Streaming Markdown parser for incremental rendering of markdown as it's written, targeting AI chat-style outputs. Current version 0.2.15. Actively developed with experimental features. Ships TypeScript types. Key differentiator: optimistic parsing – immediately renders partial tokens (e.g., inline code, bold) without waiting for closing markers, supporting selectable text during streaming. The library exposes a custom Renderer interface for DOM control, with built-in default renderer and logger renderer. Minimal bundle size (~3 kB gzipped). Requires Node >=20 for server-side use.","status":"active","version":"0.2.15","language":"javascript","source_language":"en","source_url":"https://github.com/thetarnav/streaming-markdown","tags":["javascript","markdown","parser","html","ai","typescript"],"install":[{"cmd":"npm install streaming-markdown","lang":"bash","label":"npm"},{"cmd":"yarn add streaming-markdown","lang":"bash","label":"yarn"},{"cmd":"pnpm add streaming-markdown","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only module, default export is not available. Use named imports.","wrong":"import parser from 'streaming-markdown'","symbol":"parser","correct":"import { parser } from 'streaming-markdown'"},{"note":"CommonJS require() not supported; use ESM imports.","wrong":"const { default_renderer } = require('streaming-markdown')","symbol":"default_renderer","correct":"import { default_renderer } from 'streaming-markdown'"},{"note":"Function is named parser_write, not write. Check documentation for exact exports.","wrong":"import { write } from 'streaming-markdown'","symbol":"parser_write","correct":"import { parser_write } from 'streaming-markdown'"}],"quickstart":{"code":"import * as smd from 'streaming-markdown';\n\nconst element = document.getElementById('output');\nconst renderer = smd.default_renderer(element);\nconst parser = smd.parser(renderer);\n\nsmd.parser_write(parser, \"# Hello \");\nsmd.parser_write(parser, \"World\\n\\n\");\nsmd.parser_write(parser, \"This is **bold** and *italic* text.\");\nsmd.parser_end(parser);","lang":"typescript","description":"Demonstrates creating a parser with default_renderer, writing markdown chunks, and ending the stream."},"warnings":[{"fix":"Check the GitHub README for supported features before relying on it in production.","message":"Parser is experimental; markdown features may be incomplete or behave unexpectedly.","severity":"gotcha","affected_versions":">=0.2.15"},{"fix":"Update custom renderers to use 'class' attribute for language.","message":"In v0.0.15, the attribute for code blocks changed from 'lang' to 'class'. Custom renderers relying on 'lang' will break.","severity":"breaking","affected_versions":">=0.0.15"},{"fix":"Upgrade Node.js to version 20 or later.","message":"Node >=20 required. Older versions will cause runtime errors.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Use import statements or switch to ESM in your project.","message":"The package is ESM-only; CommonJS require() will fail.","severity":"gotcha","affected_versions":">=0.2.0"}],"env_vars":null,"search_vec":"'0.2.15':24 '20':82 '3':77 'activ':25 'ai':17,92 'bold':44 'built':67 'built-in':66 'bundl':75 'chat':19 'chat-styl':18 'close':48 'code':43 'control':64 'current':22 'custom':59 'default':69 'develop':26 'differenti':34 'dom':63 'e.g':41 'experiment':28 'expos':57 'featur':29 'gzip':79 'html':91 'immedi':37 'increment':8 'inlin':42 'interfac':61 'javascript':88 'kb':78 'key':33 'librari':56 'logger':72 'markdown':3,5,11,89 'marker':49 'minim':74 'node':81 'optimist':35 'output':21 'pars':36 'parser':6,90 'partial':39 'render':9,38,60,70,73 'requir':80 'select':51 'server':85 'server-sid':84 'ship':30 'side':86 'size':76 'stream':2,4,54 'streaming-markdown':1 'style':20 'support':50 'target':16 'text':52 'token':40 'type':32 'typescript':31,93 'use':87 'version':23 'wait':46 'without':45 'written':15","created_at":"2026-05-09T05:54:48.996739+00:00","updated_at":"2026-05-09T05:54:48.996739+00:00","problems":[{"fix":"Use named imports: import { parser } from 'streaming-markdown'","cause":"Trying to default import from an ESM-only module that only exports named exports.","error":"SyntaxError: The requested module 'streaming-markdown' does not provide an export named 'default'"},{"fix":"Install with npm install streaming-markdown and ensure Node >=20.","cause":"Package not installed or running in an unsupported environment (e.g., Node <20).","error":"Error: Cannot find module 'streaming-markdown'"},{"fix":"Verify the correct import: import { default_renderer } from 'streaming-markdown'","cause":"Importing wrong symbol or using a version prior to v0.0.15 where the function existed.","error":"TypeError: smd.default_renderer is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://thetarnav.github.io/streaming-markdown","github":"https://github.com/thetarnav/streaming-markdown","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/streaming-markdown","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","serialization","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-09","next_check":"2026-08-07","install_tag":null}}