This guide walks you through installing and using the Hashnode Content Converter.
hashnode-export.json)npm install -g @alvincrespo/hashnode-content-converter
npm install @alvincrespo/hashnode-content-converter
After global installation:
hashnode-converter convert \
--export ./hashnode-export.json \
--output ./blog/posts
Or with npx:
npx @alvincrespo/hashnode-content-converter convert \
--export ./hashnode-export.json \
--output ./blog/posts
import { Converter } from '@alvincrespo/hashnode-content-converter';
// Simple one-liner
const result = await Converter.fromExportFile('./export.json', './blog');
console.log(`Converted: ${result.converted}`);
console.log(`Skipped: ${result.skipped}`);
console.log(`Errors: ${result.errors}`);
After conversion, your output directory will contain:
blog/
├── my-first-post/
│ ├── index.md # Converted markdown with frontmatter
│ └── images/ # Downloaded images
│ ├── hero.png
│ └── screenshot.jpg
├── another-post/
│ ├── index.md
│ └── images/
└── ...
Each converted file includes YAML frontmatter:
---
title: "My First Post"
slug: "my-first-post"
date: "2024-01-15T10:30:00.000Z"
tags:
- javascript
- tutorial
coverImage: "./images/hero.png"
---
Your markdown content here...