markbun
v0.3.0
Published
Render markdown beautifully in your terminal — powered by Bun.markdown
Maintainers
Readme
markbun
Render markdown beautifully in your terminal — powered by Bun's native Bun.markdown engine.
Blazingly fast. ANSI-colored terminal output and HTML export.
Install
bun install -g markbunUsage
# Render a file to the terminal
markbun README.md
# Render from stdin
cat README.md | markbun
# Export to HTML
markbun doc.md --html -o doc.html
# Custom line width
markbun article.md --columns 60
# Disable colors (plain text)
markbun README.md --no-color
# Enable clickable links
markbun README.md --hyperlinks
# Light terminal theme
markbun README.md --lightOptions
| Flag | Description |
| ----------------------- | ----------------------------------------- |
| --html, -H | Output as HTML instead of ANSI |
| --out, -o <file> | Write output to file |
| --columns, -w <n> | Line width for wrapping (default: 80) |
| --no-color | Disable ANSI colors |
| --hyperlinks | Enable clickable OSC 8 hyperlinks |
| --light | Use light terminal theme colors |
| --images | Display inline images (Kitty protocol) |
| --collapse-whitespace | Collapse whitespace in text |
| --permissive-atx | Allow ATX headers without space after # |
| --no-indented-code | Disable indented code blocks |
| --no-html-blocks | Disable HTML blocks |
| --no-html-spans | Disable inline HTML spans |
| --tag-filter | Enable GFM tag filter |
| --version, -v | Show version |
| --help, -h | Show help |
Features
- Terminal rendering via
Bun.markdown.ansi()— headings, lists, tables, code blocks with syntax highlighting, blockquotes, links, images, and horizontal rules - HTML export via
Bun.markdown.html()— GitHub Flavored Markdown support (tables, strikethrough, task lists) with configurable parser options - Custom rendering via
render()— fine-grained control over output with per-element callbacks - React rendering via
renderToReact()— render markdown to React JSX elements - Stdin support — pipe markdown directly into the tool
- Fast — built on Bun's native runtime with zero overhead
Development
# Install dependencies
bun install
# Run in development
bun start -- README.md
# Lint and format
bun run check
# Build for distribution (JavaScript)
bun run build
# Build a standalone executable
bun run build:compileThe build:compile script creates a native binary (markbun) for the current platform using Bun's --compile flag.
Publishing
bun run build
npm publishThe prepublishOnly hook runs the build automatically.
License
Apache 2.0
