@markitdownjs/core
v0.2.0
Published
Core document conversion pipeline for MarkItDownJS
Readme
@markitdownjs/core
Core orchestration package for MarkItDownJS. Provides the plugin registry, document pipeline, and renderer — the central package most users install.
Install
npm install @markitdownjs/coreInstall converter packages separately as needed:
npm install @markitdownjs/pdf @markitdownjs/docx @markitdownjs/htmlUsage
import { MarkItDown } from "@markitdownjs/core";
import { PdfConverter } from "@markitdownjs/pdf";
const parser = new MarkItDown();
parser.registerConverter(new PdfConverter());
const result = await parser.convert({ source: fileBuffer, mimeType: "application/pdf" });
console.log(result.markdown);Key Exports
| Export | Description |
|---|---|
| MarkItDown | Main entry point — register converters, run conversions |
| MarkItDownOptions | Configuration options for the MarkItDown constructor |
| DefaultConverterRegistry | Built-in registry for managing converter plugins |
| DocumentPipeline | Low-level pipeline for transforming ConversionInput → AST |
| MarkdownRenderer | Renders a DocumentNode AST to Markdown string |
| MetadataExtractor | Extracts title, author, dates, and other document metadata |
| AssetManager | Handles embedded asset resolution (images, attachments) |
Options
const parser = new MarkItDown({
includeMetadata: true,
assetBasePath: "./assets",
});Result Shape
interface ConversionResult {
markdown: string;
ast: DocumentNode;
metadata: Record<string, unknown>;
}Part of the MarkItDownJS monorepo.
