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.

📚 Documentation Structure

Quick Start

Usage Guides

Configuration

Deployment

Development

🚀 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

📄 License

Flashot is released under the MIT License.


Ready to get started? Check out our Installation Guide or jump straight to Examples!