Markdown and GitHub Flavored Markdown (GFM) parser that converts .md files into the Nous Document Model.
npm install @nousdev/parser-mdimport { createMarkdownParser } from '@nousdev/parser-md';
const parser = createMarkdownParser();
const doc = await parser.parse('# Hello\n\nSome **bold** text.', {
filePath: 'docs/intro.md',
format: 'md',
});import { mdastToNDM, extractText } from '@nousdev/parser-md';
// Convert a remark MDAST tree directly to NDM nodes
const ndmNodes = mdastToNDM(mdastTree);
// Extract plain text from an inline node array
const plain = extractText(inlineNodes);createMarkdownParser(options?)-- returns aNousParserfor.mdand.markdownfiles with GFM and frontmatter supportmdastToNDM(tree)-- convert a remark MDAST syntax tree into NDM block nodesextractText(nodes)-- extract plain text content from inline node arrays
- YAML frontmatter extraction
- GFM extensions (tables, strikethrough, task lists, autolinks)
- Heading hierarchy with source location tracking
- Code blocks with language and metadata annotations
Built on unified with remark-parse, remark-gfm, and remark-frontmatter.
MIT