{"id":27996767,"url":"https://github.com/litingyes/mdast-util-to-vnode","last_synced_at":"2025-10-14T09:15:25.018Z","repository":{"id":282132790,"uuid":"947282846","full_name":"litingyes/mdast-util-to-vnode","owner":"litingyes","description":"mdast utility to get the vue vnode","archived":false,"fork":false,"pushed_at":"2025-09-19T16:16:07.000Z","size":455,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T05:51:26.510Z","etag":null,"topics":["ai","markdown","mdast","mdast-util","remark","stream","unified","vnode","vue"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/litingyes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-12T12:51:50.000Z","updated_at":"2025-09-19T16:16:07.000Z","dependencies_parsed_at":"2025-07-06T19:02:19.899Z","dependency_job_id":"719c6b89-7153-43e0-9b53-ed0315d3092d","html_url":"https://github.com/litingyes/mdast-util-to-vnode","commit_stats":null,"previous_names":["litingyes/mdast-util-to-vnode"],"tags_count":7,"template":false,"template_full_name":"litingyes/typescript-starter","purl":"pkg:github/litingyes/mdast-util-to-vnode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litingyes%2Fmdast-util-to-vnode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litingyes%2Fmdast-util-to-vnode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litingyes%2Fmdast-util-to-vnode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litingyes%2Fmdast-util-to-vnode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litingyes","download_url":"https://codeload.github.com/litingyes/mdast-util-to-vnode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litingyes%2Fmdast-util-to-vnode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018504,"owners_count":26086383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","markdown","mdast","mdast-util","remark","stream","unified","vnode","vue"],"created_at":"2025-05-08T21:49:51.940Z","updated_at":"2025-10-14T09:15:24.991Z","avatar_url":"https://github.com/litingyes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mdast-util-to-vnode\n\nmdast utility to get the vue vnode\n\n## What is this?\n\nThis package is a utility that takes [mdast](https://github.com/syntax-tree/mdast) input and turns it into an [Vue.js](https://github.com/vuejs/core) VNode.\n\n## When should I use this?\n\n\u003e [!TIP]\n\u003e Vue Markdown: the vue component for render markdown string, and support streaming for AI. [Learn more 👉](https://github.com/litingyes/vue-markdown)\n\nIf you want to use Vue.js to render mdast, use it. It is especially useful when you want to render streamed MarkDown strings in AI application development.\n\n## Install\n\n```bash\nnpm install mdast-util-to-vnode\n```\n\n## Use\n\nSay we have the following markdown file `example.md`:\n\n```md\n# Heading\n\n`mdast-util-to-vnode` is a mdast utility to get the vue vnode.\n```\n\nAnd our module `example.js` looks as follows:\n\n```js\nimport fs from 'node:fs/promises'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport { toVNode } from 'mdast-util-to-vnode'\n\nconst doc = await fs.readFile('example.md')\nconst vnode = toVNode(fromMarkdown(doc))\n\nconsole.log(vnode)\n```\n\nNow running node example.js yields (some info removed for brevity):\n\n```json\n{\n  \"type\": \"div\",\n  \"props\": null,\n  \"key\": null,\n  \"children\": [\n    {\n      \"type\": \"h1\",\n      \"props\": null,\n      \"key\": null,\n      \"children\": [\n        {\n          \"props\": null,\n          \"key\": null,\n          \"children\": \"Heading\"\n        }\n      ]\n    },\n    {\n      \"type\": \"p\",\n      \"props\": null,\n      \"key\": null,\n      \"children\": [\n        {\n          \"type\": \"code\",\n          \"props\": null,\n          \"key\": null,\n          \"children\": \"mdast-util-to-vnode\"\n        },\n        {\n          \"props\": null,\n          \"key\": null,\n          \"children\": \" is a mdast utility to get the vue vnode.\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n## API\n\nThis package exports the identifier `toVNode`. There is no default export.\n\n### toVNode(mdast[, options])\n\n#### options\n\nSupport passing in custom Vue components to override mdast nodes.\n\n```ts\nexport type ComponentReturn = Component | [Component, Record\u003cstring, any\u003e | undefined]\n\nexport interface ToVNodeOptions {\n  components?: Partial\u003cRecord\u003cNodes['type'], ComponentReturn |\n  ((node: Node) =\u003e ComponentReturn)\u003e\u003e\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitingyes%2Fmdast-util-to-vnode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitingyes%2Fmdast-util-to-vnode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitingyes%2Fmdast-util-to-vnode/lists"}