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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bunpressjs/bunpress

v0.1.2

Published

⚡ Lightweight Express-style web framework built for the Bun runtime.

Readme

Bunpress 🚀

A lightweight, Express.js-inspired web framework built specifically for Bun - the fast all-in-one JavaScript runtime.

Features

  • 🚀 Fast: Built on top of Bun's native HTTP server
  • 🪶 Lightweight: Minimal footprint with zero dependencies
  • 🔧 Simple: Express.js-like API that's familiar and easy to use
  • TypeScript: Full TypeScript support out of the box
  • 🎯 Modern: Uses modern JavaScript features and Web APIs

Installation

Make sure you have Bun installed on your system.

# Clone the repository
git clone <repository-url>
cd bunpress

# Install dependencies
bun install

Quick Start

Here's a simple example to get you started:

import { Bunpress } from "./src";

const app = new Bunpress();

// Define routes
app.get("/", () => new Response("Hello from Bunpress!"));

app.get("/user", () =>
  new Response(JSON.stringify({ name: "Abhinay", role: "creator" }), {
    headers: { "Content-Type": "application/json" },
  })
);

// Start the server
app.listen(3000);

API Reference

Creating an App

import { Bunpress } from "bunpress";

const app = new Bunpress();

Route Methods

Currently supported HTTP methods:

GET Routes

app.get(path: string, handler: Handler)

POST Routes

app.post(path: string, handler: Handler)

Handler Function

A handler function receives a Request object and should return a Response or a Promise<Response>:

type Handler = (req: Request) => Response | Promise<Response>;

Starting the Server

app.listen(port: number)

Starts the server on the specified port and returns a Bun server instance.

Examples

Basic Server

import { Bunpress } from "./src";

const app = new Bunpress();

app.get("/", () => new Response("Hello World!"));

app.listen(3000);
console.log("Server running on http://localhost:3000");

JSON API

import { Bunpress } from "./src";

const app = new Bunpress();

app.get("/api/users", () => {
  const users = [
    { id: 1, name: "John Doe" },
    { id: 2, name: "Jane Smith" }
  ];
  
  return new Response(JSON.stringify(users), {
    headers: { "Content-Type": "application/json" }
  });
});

app.post("/api/users", async (req) => {
  const body = await req.json();
  console.log("New user:", body);
  
  return new Response(JSON.stringify({ success: true }), {
    headers: { "Content-Type": "application/json" },
    status: 201
  });
});

app.listen(3000);

Project Structure

bunpress/
├── src/
│   ├── index.ts          # Main export
│   ├── core/
│   │   ├── app.ts        # Main Bunpress class
│   │   ├── middleware.ts # Middleware system (planned)
│   │   ├── response.ts   # Response utilities (planned)
│   │   └── router.ts     # Advanced routing (planned)
│   └── utils/
│       ├── helper.ts     # Utility functions (planned)
│       └── mime.ts       # MIME type handling (planned)
├── examples/
│   ├── basic.ts          # Basic usage example
│   ├── middleware.ts     # Middleware example (planned)
│   └── routing.ts        # Advanced routing example (planned)
├── tests/
│   └── server.test.ts    # Test files (planned)
├── package.json
├── tsconfig.json
└── bunfig.toml

Development

Running Examples

# Run the basic example
bun run examples/basic.ts

# The server will start on http://localhost:3000

Running Tests

bun test

Roadmap

Planned Features

  • [ ] Middleware Support: Add middleware system for request/response processing
  • [ ] Advanced Routing: Path parameters, wildcards, and route groups
  • [ ] Static File Serving: Built-in static file middleware
  • [ ] Request Parsing: Built-in JSON, form data, and multipart parsing
  • [ ] Response Helpers: Convenient methods for common response types
  • [ ] Error Handling: Global error handling and custom error pages
  • [ ] CORS Support: Cross-origin resource sharing middleware
  • [ ] Rate Limiting: Built-in rate limiting capabilities
  • [ ] Logging: Request/response logging middleware
  • [ ] WebSocket Support: Real-time communication support

HTTP Methods to Add

  • [ ] PUT
  • [ ] DELETE
  • [ ] PATCH
  • [ ] HEAD
  • [ ] OPTIONS

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Requirements

  • Bun 1.0 or higher
  • TypeScript 5.0 or higher

License

This project is open source and available under the MIT License.

Acknowledgments

  • Inspired by Express.js
  • Built for the Bun runtime
  • Created by Abhinay Ambati

Note: Bunpress is currently in early development. Many features are planned but not yet implemented. Check the roadmap above for upcoming features.