@markxmind/markxmind-core
v0.1.2
Published
MarkXMind parser - Parse Markdown-like syntax to XMind mind map data structure.
Maintainers
Readme
@markxmind/markxmind-core
MarkXMind parser — turn Markdown-like text into XMind mind map data.
🎉 Use MarkXMind online
MarkXMind is an online editor that builds mind maps from XMindMark syntax. It offers real-time preview, export to .xmind / .svg / .png, and import of existing XMind files. Try it now →
⚙️ Requirements
- Node.js ≥ 18 (when used in Node).
- Bundlers / runtimes that support ES modules and/or CommonJS (package ships both).
📦 Install
npm install @markxmind/markxmind-core📚 API
| Function | Description |
| ------------------------------------------------------------------------------ | -------------------------------------------------------------------- |
| createMapByXMindMark(raw?: string) | Parse XMindMark text into a SheetModel (XMind sheet data). |
| parseXMindMarkToXMindFile(content: string) | Convert XMindMark text to a .xmind file (Promise<ArrayBuffer>). |
| parseXMindToXMindMarkFile(xmindFile: ArrayBuffer, targetSheetOrder?: number) | Parse a .xmind file and return XMindMark text (Promise<string>). |
💡 Usage
import {
createMapByXMindMark,
parseXMindMarkToXMindFile,
parseXMindToXMindMarkFile,
type SheetModel
} from "@markxmind/markxmind-core"
// Parse XMindMark text into a data structure
const sheetModel: SheetModel = createMapByXMindMark(`
Central Topic
- Main Topic 1
- Main Topic 2
- Subtopic 2.1
- Subtopic 2.2
`)
// Export as .xmind file
const arrayBuffer = await parseXMindMarkToXMindFile(xmindMarkContent)
// Read .xmind file as XMindMark text
const xmindMarkText = await parseXMindToXMindMarkFile(xmindFileBuffer)📐 Type exports
import type {
SheetModel,
TopicModel,
TopicChildren,
TopicType,
BoundaryModel,
SummaryModel,
RelationshipModel
} from "@markxmind/markxmind-core"🎯 Use cases
- Web editors — Live preview of MarkXMind text.
- CLI tools — Convert between
.xmindand.xmindmarkon the command line.
📄 License
MIT
