Fast, modern documentation engine powered by Bun, inspired by VitePress
BunPress is a lightning-fast static site generator designed specifically for documentation. Built on top of Bun's blazing performance with a developer-friendly API inspired by VitePress.
- β‘ Lightning Fast - ~500ms build time (100 files), 2nd fastest after Hugo
- π Rich Markdown - VitePress-compatible markdown with containers, alerts, code groups, and syntax highlighting
- π Smart TOC - Automatic table of contents with filtering, positioning (sidebar/inline/floating), and interactive navigation
- π οΈ Developer Friendly - Native TypeScript support, comprehensive CLI (15+ commands), and extensive customization
- π Complete SEO - Auto-generated sitemap.xml, robots.txt, Open Graph tags, and JSON-LD structured data
- π Fathom Analytics - Privacy-focused analytics with GDPR/CCPA compliance and DNT support
- π SEO Validation - Built-in SEO checker with auto-fix mode for common issues
- β Custom containers (info, tip, warning, danger, details, raw)
- β GitHub-flavored alerts (note, tip, important, warning, caution)
- β Code features (line highlighting, line numbers, focus, diffs, errors/warnings, groups)
- β Code imports from files with line ranges and regions
- β Tables with alignment and formatting
- β Image enhancements with captions and lazy loading
- β Custom header anchors and inline TOC
- π Fast Dev Server - ~100ms startup, hot reload, and instant feedback
- π¦ Small Bundles - ~45KB per page (HTML + JS + CSS)
- π Low Memory - ~50MB dev server, ~250MB peak for 1000 files
- π― 15+ CLI Commands - Build, dev, preview, stats, doctor, SEO check, and more
Get started with BunPress in seconds:
# Install BunPress
bun add @stacksjs/bunpress
# Create a new documentation site
mkdir my-docs
cd my-docs
# Initialize with basic structure
bunx @stacksjs/bunpress init
# Start development server
bun run dev
# Build for production
bun run buildCreate your first documentation page:
---
title: Welcome
layout: home
---
# Welcome to My Project
This is my awesome project documentation built with BunPress!
## Quick Links
- [Getting Started](/guide/getting-started)
- [API Reference](/api)
- [Examples](/examples)Configure your site in bunpress.config.ts:
export default {
title: 'My Documentation',
description: 'Built with BunPress',
nav: [
{ text: 'Home', link: '/' },
{ text: 'Guide', link: '/guide' },
{ text: 'API', link: '/api' }
],
// SEO Configuration
sitemap: {
enabled: true,
baseUrl: 'https://mysite.com',
},
robots: {
enabled: true,
},
// Analytics
fathom: {
enabled: true,
siteId: 'YOUR_SITE_ID',
honorDNT: true,
},
}BunPress provides a comprehensive CLI for managing your documentation:
# Development
bunpress dev # Start dev server with hot reload
bunpress build # Build for production
bunpress preview # Preview production build
# Content Management
bunpress new <path> # Create new markdown file
bunpress init # Initialize new project
# Maintenance
bunpress clean # Remove build artifacts
bunpress stats # Show documentation statistics
bunpress doctor # Run diagnostic checks
# SEO
bunpress seo:check # Check SEO for all pages
bunpress seo:check --fix # Auto-fix SEO issues
# Configuration
bunpress config:show # Show current configuration
bunpress config:validate # Validate configurationCompared to major documentation generators (100 markdown files):
| Generator | Build Time | Dev Startup | Bundle Size | Memory |
|---|---|---|---|---|
| BunPress | ~500ms | ~100ms | ~45KB | ~50MB |
| Hugo | ~300ms | ~50ms | ~10KB | ~30MB |
| VitePress | ~2.5s | ~800ms | ~120KB | ~150MB |
| Docusaurus | ~8s | ~3s | ~250KB | ~300MB |
BunPress is 5x faster than VitePress and 16x faster than Docusaurus.
See benchmarks/ for detailed comparison.
bun test # Run all tests
bun test:quick # Quick test run (10s timeout)
bun run typecheck # Type checking
bun run lint # Lint codePlease see our releases page for more information on what has changed recently.
Please see CONTRIBUTING for details.
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
For casual chit-chat with others using this package:
Join the Stacks Discord Server
βSoftware that is free, but hopes for a postcard.β We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States π
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
The MIT License (MIT). Please see LICENSE for more information.
Made with π
