Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@mazhu/mdserver

Local Markdown preview server with live reload

Features

  • 🚀 Instant Preview - Preview Markdown files in your browser
  • 🔄 Live Reload - Auto-refresh when files change via WebSocket
  • 📂 File Watching - Monitor specific files for changes
  • 🎨 Beautiful Styling - Clean, readable output with syntax highlighting
  • 🌐 WebSocket Powered - Real-time communication between server and browser

Installation

npm install -g @mazhu/mdserver

Usage

Start the server

mdserver start

Preview a specific file

mdserver start readme.md

Open browser (when server is running)

mdserver open

Watch a file for changes

mdserver watch readme.md

Commands

Command Description
mdserver start [file] Start the preview server, optionally with a file
mdserver open Open the preview in browser
mdserver watch [file] Watch a file and auto-reload
mdserver --version Show version
mdserver --help Show help

API

Endpoints

  • GET / - Root page
  • GET /file?path=<path> - Preview specific file
  • GET /open?file=<path> - Load file and notify all clients

WebSocket Events

  • content - File content update
  • reload - Trigger page reload

License

MIT

About

Local Markdown preview server with live reload

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages