Documentation
Fast & Easy
Multiple Formats
Highly Customizable
Transform your code into beautiful, shareable images with powerful customization options. Perfect for social media, documentation, and presentations.
Installation
Learn more
Get started with Flashot in seconds
NPM Package
Learn more
Use Flashot programmatically in your projects
CLI Tool
Learn more
Command-line interface for quick generation
REST API
Learn more
HTTP API for integration and automation
Examples
Learn more
Real-world examples and use cases
Configuration
Learn more
Customize themes, languages, and output
📚 Documentation Structure
Quick Start
- Installation - Get started with Flashot in minutes
- Quick Examples - Jump right in with practical examples
Usage Guides
- NPM Package Usage - Use Flashot as a library in your projects
- CLI Usage - Command-line interface guide
- API Reference - REST API endpoints and usage
Configuration
- Options & Configuration - Comprehensive options guide
- Themes & Languages - Supported themes and programming languages
- Advanced Usage - Performance tips and advanced features
Deployment
- Docker Deployment - Deploy with Docker and Docker Compose
- Production Setup - Best practices for production environments
Development
- Contributing - How to contribute to Flashot
- Architecture - Technical architecture and design decisions
🚀 What is Flashot?
Flashot is a powerful tool that converts code snippets into beautiful, shareable images with syntax highlighting. It's designed to be:
- ⚡ Blazing Fast: Generates images in ~135ms
- 🎨 Beautiful: Professional syntax highlighting with multiple themes
- 🔧 Flexible: Multiple input methods (code, files, URLs, buffers)
- 📦 Lightweight: Minimal dependencies
- 🛠️ Easy to Use: Simple API for seamless integration
📦 Installation Options
NPM Package
npm install flashot
CLI Tool
npm install -g flashot
Docker
docker pull ghcr.io/thuongtruong109/flashot-api:latest
🎯 Use Cases
- Documentation: Create beautiful code examples for README files
- Social Media: Share code snippets on Twitter, LinkedIn, or blogs
- Presentations: Generate images for slides and presentations
- Tutorials: Create visual code examples for educational content
- API Integration: Programmatically generate code images in your applications
🌟 Key Features
- 🖥️ Multiple Interfaces: CLI, NPM package, and REST API
- 📥 Flexible Input: Inline code, file paths, URLs, and buffers
- 🎨 Rich Customization: 25+ themes, custom fonts, line numbers
- 📦 Multiple Formats: PNG, JPEG, WebP, AVIF output
- 🔍 Syntax Highlighting: Support for 25+ programming languages
- ⚡ High Performance: Optimized rendering with caching
- 🛠️ Easy Integration: TypeScript support with comprehensive API
📖 Quick Example
import { writeFile } from "node:fs/promises";
import { codeToImg } from "flashot";
const buffer = await codeToImg('console.log("Hello, World!");', {
lang: "javascript",
theme: "github-dark",
format: "png",
});
await writeFile("hello-world.png", buffer);
🔗 Quick Links
🤝 Getting Help
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Questions and community support
- Contributing Guide - How to contribute to the project
📄 License
Flashot is released under the MIT License.
Ready to get started? Check out our Installation Guide or jump straight to Examples!