hashnode-md
Version:
CLI tool to export Hashnode blog posts to Markdown format
122 lines (80 loc) ⢠3.12 kB
Markdown
# hashnode-md š
<div align="center">



[](https://www.npmjs.com/package/hashnode-md)
[](https://opensource.org/licenses/MIT)
**A sleek, modern CLI tool to export your Hashnode blog posts to Markdown format in seconds.**
</div>
## ⨠Features
- **š Effortless Search**: Quickly find and list your Hashnode blog posts by blog name
- **ā¬ļø One-Click Export**: Convert selected posts to clean Markdown format with a single command
- **šØ Formatting Preservation**: Maintains all your original article formatting from Hashnode
- **š Organized Output**: Automatically saves exported files in the `output` directory
- **š» Interactive CLI**: User-friendly command-line interface with intuitive prompts
## š Installation
### Using npm
```bash
npm install -g hashnode-md
```
### Using Bun
```bash
bun install -g hashnode-md
```
## š® Usage
Run the CLI tool with a simple command:
```bash
hashnode-md
```
### Interactive Workflow
The tool will guide you through a simple process:
1. **Enter your blog name** - Just the name without `.hashnode.dev`
2. **Select a post** - Choose from a list of your recent articles
3. **Export complete** - Your Markdown file is ready in the `output` directory!
## š Example
```bash
$ hashnode-md
? Enter the name of the blog in hashnode (without .hashnode.dev): techblog
? Select the post to convert to markdown: How I Built a Serverless API in 10 Minutes
⨠how-i-built-a-serverless-api-in-10-minutes.md created successfully
```
<div align="center">
<img src="https://via.placeholder.com/600x400/0a0a0a/FFFFFF?text=hashnode-md+CLI+demo" alt="CLI Demo" width="600"/>
</div>
## š¦ What You Get
The exported Markdown file includes:
- The original post title as a heading
- All content with proper Markdown formatting
- Code blocks with language highlighting
- Images with proper formatting
## š ļø Development
Want to contribute or run locally?
### Clone the repository
```bash
git clone https://github.com/elvisbrevi/hashnode-to-markdown.git
cd hashnode-to-markdown
```
### Install dependencies
```bash
bun install
```
### Run locally
```bash
bun start
```
### Build for production
```bash
bun run build
```
## š§ Technical Details
- Built with TypeScript and Bun for modern JavaScript development
- Uses Hashnode's GraphQL API to fetch blog posts
- Interactive CLI powered by Inquirer.js
## š License
[MIT](LICENSE) Ā© Elvis Brevi
---
<div align="center">
<p>If you find this tool helpful, consider giving it a ā on <a href="https://github.com/elvisbrevi/hashnode-to-markdown">GitHub</a>!</p>
<p>Made with ā¤ļø for the Hashnode community</p>
</div>