{"_id":"@axiia/stream-markdown","_rev":"2-2d6d77bf54e00af9f18f6a6d9c8944df","name":"@axiia/stream-markdown","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@axiia/stream-markdown","version":"0.0.1","_id":"@axiia/stream-markdown@0.0.1","maintainers":[{"name":"selveskii","email":"lambda@liu.ms"}],"dist":{"shasum":"bf26156fb92209e70b4cecd9e0a163d098419a65","tarball":"https://registry.npmjs.org/@axiia/stream-markdown/-/stream-markdown-0.0.1.tgz","fileCount":7,"integrity":"sha512-lxzNQzc91PHm+qyFOhklgnRWhgEPD8z5WwBm33lL1OxTRiGA/vqVKtb180y4NPLc552pXXt3c3GqxEQ7Swmwxw==","signatures":[{"sig":"MEUCIFIRdWtGh4ChxTPKTemFPZKT0smwjRRT0LlOSQHvtEbLAiEAgBY1Ag/kzgkD20YOGPGvEuW0LfXh6IWERMS9ZycbYuk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19790},"main":"./src/index.ts","type":"module","types":"./src/index.ts","module":"./src/index.ts","exports":"./src/index.ts","gitHead":"c3f0f5bd5e6e87e7c4ac2af3499a0080f44680e1","_npmUser":{"name":"selveskii","email":"lambda@liu.ms"},"_npmVersion":"11.6.0","description":"Progressive Markdown streaming for React, powered by the remark ecosystem with headless primitives and directive support.","directories":{},"_nodeVersion":"23.11.0","dependencies":{"hast":"^1.0.0","mdast":"^3.0.0","react":"^19.1.1","unified":"^11.0.5","remark-parse":"^11.0.0","remark-directive":"^4.0.0","mdast-util-to-hast":"^13.2.0","mdast-util-directive":"^3.1.0","hast-util-to-jsx-runtime":"^2.3.6"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.7","esbuild":"^0.25.10","react-dom":"^19.1.1","@types/hast":"^3.0.4","@types/mdast":"^4.0.4","@types/react":"^19.1.13","@types/react-dom":"^19.1.9","@vitejs/plugin-react-swc":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/stream-markdown_0.0.1_1758706121350_0.8100663080164494","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@axiia/stream-markdown","version":"0.0.2","type":"module","exports":"./src/index.ts","main":"./src/index.ts","module":"./src/index.ts","types":"./src/index.ts","dependencies":{"hast":"^1.0.0","hast-util-to-jsx-runtime":"^2.3.6","mdast":"^3.0.0","mdast-util-directive":"^3.1.0","mdast-util-to-hast":"^13.2.0","react":"^19.1.1","remark-directive":"^4.0.0","remark-parse":"^11.0.0","unified":"^11.0.5"},"devDependencies":{"@types/hast":"^3.0.4","@types/mdast":"^4.0.4","@types/react":"^19.1.13","@types/react-dom":"^19.1.9","@vitejs/plugin-react-swc":"^4.1.0","esbuild":"^0.25.10","react-dom":"^19.1.1","vite":"^7.1.7"},"_id":"@axiia/stream-markdown@0.0.2","gitHead":"e769e7adc28d78e496a1c5c0f6c6b209b77964e7","description":"Progressive Markdown streaming for React, powered by the remark ecosystem with headless primitives and directive support.","_nodeVersion":"23.11.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-KVazVK8DqzQrcP413f9V+Lah/bua5Dc3CejHbRP27pYhhBkhwYfyVDobc/d71n0u8GAjJhXDk/uj2HvuuwwOag==","shasum":"a9f9e2e2af09663a5c358ef37811e64c1026ff14","tarball":"https://registry.npmjs.org/@axiia/stream-markdown/-/stream-markdown-0.0.2.tgz","fileCount":8,"unpackedSize":18277,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCvGqqCHCER+zSzi0qjZuuT9fK3xd8Gx8qJjfrvmxWAwgIgSpyHpxbj8gfVbF6bGRAOKBtmt6n64k4qOa27ssYIiAA="}]},"_npmUser":{"name":"selveskii","email":"lambda@liu.ms"},"directories":{},"maintainers":[{"name":"selveskii","email":"lambda@liu.ms"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stream-markdown_0.0.2_1758726793937_0.22361105127555514"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-24T09:28:41.266Z","modified":"2025-09-24T15:13:14.358Z","0.0.1":"2025-09-24T09:28:41.528Z","0.0.2":"2025-09-24T15:13:14.135Z"},"description":"Progressive Markdown streaming for React, powered by the remark ecosystem with headless primitives and directive support.","maintainers":[{"name":"selveskii","email":"lambda@liu.ms"}],"readme":"# Stream Markdown\n\nProgressive Markdown streaming for React, powered by the remark ecosystem with\nheadless primitives and directive support.\n\n---\n\n## Try The Examples\n\n```bash\ndeno task example basic      # streaming walkthrough\ndeno task example directive  # directive renderer demo\n```\n\n- Requires Deno 2+ with Node compatibility (default install).\n- Examples run Vite through Deno, so hot reload works out of the box.\n\n---\n\n## Overview\n\n- Stream Markdown incrementally while keeping promoted blocks stable for React\n  reconciliation.\n- Opt into directive rendering via the `remark-directive` syntax and a\n  `directives` map.\n- Headless primitives only—consumers control every piece of UI.\n- For implementation details and roadmap, see [`SPEC.md`](./SPEC.md).\n\n---\n\n## Usage\n\n```tsx\nimport { MarkdownStream } from 'stream-markdown'\n\nexport const Preview = ({ chunks }: { chunks: string[] }) => (\n  <MarkdownStream streaming chunks={chunks} />\n)\n```\n\nStable Markdown can be rendered without streaming props:\n\n```tsx\n<MarkdownStream content='# Hello world' />\n```\n\nWhen the stream finishes, render again with `streaming={false}` and the final\n`content` so the session can finalize buffered suffixes without resetting:\n\n```tsx\nconst streaming = !isComplete\n\n<MarkdownStream\n  {...(streaming\n    ? { streaming: true as const, chunks }\n    : { content: fullMarkdown })}\n/>\n```\n\n### Rendering directives\n\n```tsx\nimport type { MarkdownDirectiveComponents } from 'stream-markdown'\n\nconst directives: MarkdownDirectiveComponents = {\n  callout: ({ children }) => <aside className='callout'>{children}</aside>,\n}\n\n<MarkdownStream content=':::callout\\nContent\\n:::' directives={directives} />\n```\n\nIf no matching directive renderer is provided, directive nodes resolve to\n`null`, keeping the tree stable even when directives appear in streamed chunks.\n\n### Overriding Markdown elements\n\n```tsx\nimport type { MarkdownComponents } from 'stream-markdown'\n\nconst components: MarkdownComponents = {\n  h1: ({ children, ...rest }) => (\n    <h1 {...rest} className='text-3xl font-bold'>\n      {children}\n    </h1>\n  ),\n}\n\n<MarkdownStream content='# Styled heading' components={components} />\n```\n\n---\n\n## Development\n\n- Format & lint: `deno fmt`, `deno lint`\n- Tests: `deno test`\n- Examples: `deno task example <name>`\n\nThe [spec](./SPEC.md) captures the streaming contract, buffer promotion rules,\nand React integration notes.\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}