npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

burger-api

v0.7.1

Published

<div align="center"> <a href="https://burger-api.com"> <img src="https://github.com/user-attachments/assets/0d9b376e-1d89-479a-aa7f-e7ee3c6b2342" alt="BurgerAPI"/> </a> </div>

Downloads

298

Readme

Under Development License Bun Version

burger-api is a modern, open source API framework built on Bun.js. It combines the simplicity of file-based routing with powerful features like built-in middleware, Zod-based schema validation, and automatic OpenAPI generation. Designed for high performance and ease-of-use, burger-api leverages Bun's native modules to deliver blazing-fast API responses while keeping your codebase clean and maintainable.

This project is under active development and should not be used in production yet.

📚 Table of Contents

📖 Documentation

For detailed documentation and examples, visit the BurgerAPI official docs.

🚀 Overview

burger-api is built to offer a robust developer experience through:

  • Bun-Native Performance:
    Leverages Bun's high-performance HTTP server.

  • 📁 File-Based Routing:
    Automatically registers API routes from your file structure using a clear naming convention.

  • 🔄 Middleware Architecture:
    Supports both global and route-specific middleware. Simple, powerful middleware system with three return types:

    • Response - Stop here, send this response
    • Function - Transform the final response after handler runs
    • undefined - Continue to next middleware
  • Type-Safe Validation:
    Utilizes Zod for request validation, ensuring full type safety and automatic error reporting.

  • 📚 Automatic OpenAPI Generation:
    Generates a complete OpenAPI 3.0 specification directly from your routes and Zod schemas.

  • 🔍 Swagger UI Integration:
    Out-of-the-box Swagger UI endpoint for interactive API documentation.

🛠️ CLI Tool (Newly Added)

burger-api comes with a powerful CLI tool that makes it easy to scaffold new projects and manage middleware. Install it globally to get started:

Installation

Option 1: Bun Global Installation (Recommended if you have Bun installed)

# Global installation
bun add -g @burger-api/cli

Or use with bunx (No Installation Needed):

bunx @burger-api/cli create my-project

Option 2: Standalone Executable (Alternative Installation Method)

macOS, Linux, WSL:

curl -fsSL https://burger-api.com/install.sh | bash

Windows PowerShell:

irm https://burger-api.com/install.ps1 | iex

Option 3: Manual Download (Alternative Installation Method)

  1. Download the executable for your platform from GitHub Releases
  2. Add to PATH
  3. Make executable (Linux/macOS): chmod +x burger-api

Verify Installation (To Check if the CLI is Installed Correctly)

burger-api --version

Package Details:

Quick Start

# Create a new burger-api project
burger-api create my-api

# Navigate to your project
cd my-api

# Start development server
bun run dev

Installing Middleware

The CLI makes it easy to add production-ready middleware to your project. Browse available middleware and install them with a single command:

# List all available middleware
burger-api list

# Add middleware to your project
burger-api add cors logger rate-limiter

Popular Middleware Available:

  • cors - Cross-Origin Resource Sharing for handling cross-origin requests
  • logger - Request/response logging with detailed information
  • rate-limiter - Request rate limiting to prevent API abuse
  • jwt-auth - JWT authentication for securing your API endpoints
  • api-key-auth - API key authentication for server-to-server communication
  • compression - Response compression (gzip/deflate) to reduce bandwidth
  • security-headers - Security HTTP headers to protect against common attacks
  • cache - HTTP caching headers for improved performance
  • timeout - Request timeout to prevent long-running requests
  • body-size-limiter - Request body size limits to prevent large payload attacks

After installing middleware, the CLI will show you exactly how to use it in your project. For more information, visit the CLI documentation.

📣 Changelog

Latest Version: 0.7.0 (December 24, 2025)

  • 🔧 CLI & Release Improvements:
    • Added CLI tool for creating new projects and managing middleware
    • Updated README.md

Latest Version: 0.6.2 (November 13, 2025)

  • Major Performance Improvements:

    • middleware execution with specialized fast paths
    • AOT compilation with pre-computed middleware arrays
    • Zero runtime allocations (pre-allocated arrays)
    • Manual loop unrolling for 2-middleware case
    • Reduced code from ~110 to ~80 lines
  • 🎯 Simplified Middleware System:

    • Clearer return types: Response, Function, or undefined
    • Removed complex "around" middleware pattern
    • Dedicated fast paths for 0, 1, and 2 middlewares
    • Better JIT optimization
  • 📦 Monorepo Structure:

    • Converted to Bun workspace monorepo
    • Core framework in packages/burger-api
    • CLI tool in packages/cli (under development)
    • Ecosystem middleware at root level
  • 🔧 Developer Experience:

    • 100% backward compatible
    • Clearer documentation
    • Easier to understand codebase

Previous Version: 0.5.2 (November 9, 2025)

  • 🔧 Internal Improvements:
    • Refactored wildcard parameter extraction logic into reusable utility functions
    • Added test suites and README files for all example projects

Previous Version: 0.5.0 (November 1, 2025)

  • 🌟 Feature: Auto-injected OPTIONS handler for CORS preflight:

    • Automatically injects an OPTIONS handler for CORS preflight when needed
    • Only injects if the route defines any preflight-triggering methods and lacks an OPTIONS handler
    • Injects a minimal OPTIONS handler that returns a 204 No Content response
    • Works for all HTTP methods that trigger CORS preflight (POST, PUT, DELETE, PATCH)
    • Does not inject if the route already has an OPTIONS handler
  • 🌟 Feature: Improved response handling in middleware (after middlewares):

    • After middlewares now run even if the current middleware already returned a response
    • After middlewares run in reverse order to make changing the response easier and to help with CORS
  • 🐛 Bug Fix: Fixed TypeScript type resolution for package consumers:

    • Users now get full IntelliSense, autocomplete, and type safety out of the box

Previous Version: 0.4.0 (October 21, 2025)

  • 🌟 Feature: Wildcard Routes:
    • Added wildcard routes using [...] folder name - matches any path after it
    • Create routes that handle multiple path segments automatically
    • Access all matched path parts through wildcardParams in your request
    • Routes are matched in order: exact paths first, then dynamic routes (like [id]), then wildcards last
    • Works inside dynamic routes too (example: /api/users/[userId]/[...])
    • View wildcard routes in OpenAPI docs and Swagger UI

Previous Version: 0.3.0 (August 15, 2025)

  • 🌟 Feature: Updated Zod to version 4:
    • Updated Zod version from 3.x to 4.x
    • Updated built-in request validation middleware to use Zod 4
    • Updated and better request validation middleware error handling
    • Removed Zod-to-json-schema dependency and use Zod 4 directly

For a complete list of changes, please check the Changelog file.

🎯 What's Coming Next?

We're actively enhancing burger-api with powerful new features Stay tuned for updates as we continue to build and improve burger-api! We're committed to making it the best API framework for Bun.js.

🤝 Contributing

We welcome contributions from the community! If you have suggestions or improvements, please open an issue or submit a pull request. Let's build something amazing together.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

The MIT License is a permissive license that is short and to the point. It lets people do anything they want with your code as long as they provide attribution back to you and don't hold you liable.