https://github.com/mgks/md-fusion
Convert notes between HTML/JSON and Markdown with YAML Frontmatter. Ideal for Notion/Obsidian migrations.
https://github.com/mgks/md-fusion
converter json markdown nodejs notion npm obsidian yaml-parser
Last synced: 5 months ago
JSON representation
Convert notes between HTML/JSON and Markdown with YAML Frontmatter. Ideal for Notion/Obsidian migrations.
- Host: GitHub
- URL: https://github.com/mgks/md-fusion
- Owner: mgks
- License: mit
- Created: 2025-12-30T07:49:53.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-12-30T08:17:42.000Z (6 months ago)
- Last Synced: 2026-01-02T20:28:07.258Z (6 months ago)
- Topics: converter, json, markdown, nodejs, notion, npm, obsidian, yaml-parser
- Language: TypeScript
- Homepage:
- Size: 139 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# md-fusion
**Convert notes between HTML/JSON and Markdown with YAML Frontmatter.**
A lightweight Node.js library and CLI tool to bridge the gap between structured note data (JSON) and static file systems (Markdown). It seamlessly handles **YAML Frontmatter**, making it perfect for migrating content to **Obsidian**, **Notion**, or **Jekyll/Hugo** sites.
## Installation
```bash
# Global Install (CLI)
npm install -g md-fusion
# Project Install (Library)
npm install md-fusion
```
## Usage
### CLI Usage
**Convert JSON Notes to Markdown Files**
Perfect for importing into Obsidian or Dendron.
```bash
md-fusion to-md notes.json -o ./my-vault
# Creates: ./my-vault/note_title.md, ./my-vault/another_note.md
```
**Parse Markdown to JSON**
Useful for processing existing Markdown files.
```bash
md-fusion from-md ./my-vault/daily-note.md
# Output: JSON object to console
```
### API Usage
```javascript
import { toMarkdown, fromMarkdown } from 'md-fusion';
const myNote = {
title: "Project Idea",
content: "
Big Plans
Do the thing.
",
tags: ["ideas", "work"],
created: "2023-10-27T10:00:00Z"
};
// 1. Convert Object to Markdown string with Frontmatter
const md = toMarkdown(myNote);
console.log(md);
/* Output:
---
title: Project Idea
tags:
- ideas
- work
created: 2023-10-27T10:00:00Z
---
# Big Plans
Do the thing.
*/
// 2. Parse Markdown string back to Object
const noteObj = fromMarkdown(md);
console.log(noteObj.title); // "Project Idea"
```
### Input/Output Format
Expects (or produces) a standard JSON Note object:
```typescript
interface Note {
title: string;
content: string; // HTML
tags: string[];
created: string; // ISO 8601
updated?: string;
[key: string]: any; // Any extra JSON keys become YAML Frontmatter
}
```
## License
MIT
> **{ github.com/mgks }**
>
>  