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

@kichu12348/bunify

v1.0.5

Published

A fast, lightweight, and strictly-typed web framework built specifically for [Bun](https://bun.sh/).

Readme

Bunify

A fast, lightweight, and strictly-typed web framework built specifically for Bun.

Bunify offers a developer-friendly API heavily inspired by proven web frameworks like Fastify, but optimized for the modern Bun ecosystem. It features robust typing, lifecycle hooks, powerful routing, and middleware support right out of the box.

Installation

Since Bunify relies on native Bun features, ensure you have Bun installed.

bun add @kichu12348/bunify

Quick Start

import { Bunify } from "@kichu12348/bunify";

const app = new Bunify({ logger: true });

app.get("/hello", (request, reply) => {
  return { message: "Hello, World!" };
});

app.listen(3000, (address) => {
  console.log(`Server is running at http://${address}`);
});

Features

Type-Safe Routing

Bunify enforces strict typing on your return statements and incoming requests using RouteSchema definition.

type GreetRoute = {
  Body: { name: string };
  Query: { formal?: string };
  Params: { id: string };
  Reply: { greeting: string };
};

app.post<GreetRoute>("/greet/:id", async (request, reply) => {
  const body = await request.json(); // Strongly typed to { name: string }
  const formal = request.query.formal;
  const id = request.params.id; // Strongly typed to string

  return { greeting: `Hello ${body.name}, your id is ${id}` };
});

Middleware (use)

You can use middleware to intercept incoming requests and process them before they hit your routes. Note that you MUST call next() to proceed.

app.use(async (request, reply, next) => {
  console.log(`Incoming request: ${request.method} ${request.url}`);
  await next();
});

Lifecycle Hooks

Tap into requests at specific lifecycles. Available hooks are onRequest, preHandler, and onResponse.

app.addHook("onRequest", async (request, reply, next) => {
  // Logic here
  await next();
});

Routing & Chaining Middlewares

You can apply middleware locally per-route by chaining them before the final handler.

app.get(
  "/protected",
  async (request, reply, next) => {
    if (!request.headers.get("Authorization")) {
      return reply.status(401).json({ error: "Unauthorized" });
    }
    await next();
  },
  (request, reply) => {
    return { data: "Top Secret" };
  }
);

Decorators

Easily attach custom utilities, instances, or metadata to your Bunify application context and requests.

// Define expected decorators
type AppDecorators = { db: any };

const app = new Bunify<AppDecorators>();

app.decorate("db", { getDocs: () => [{ id: 1 }] });

app.get("/docs", (request, reply) => {
  // request.db is available and correctly typed
  return request.db.getDocs();
});

Plugins / Sub-Routers

Divide your application into logical modules combining prefixes, scoped dependencies, and decorators securely using .register().

app.register(
  (adminApp) => {
    adminApp.get("/dashboard", (request, reply) => {
      reply.html("<h1>Admin Dashboard</h1>");
    });
  },
  { prefix: "/admin" } // accessible at /admin/dashboard
);

Reply Methods

The reply object gives you fine-grained control to shape responses gracefully.

  • reply.status(code) / reply.code(code): Set the HTTP status code
  • reply.headers(key, value): Insert a new Header
  • reply.json(data): Automatically sends a JSON response
  • reply.html(content): Easily serve HTML tags
  • reply.redirect(url): Responds with a 302 redirect
  • reply.send(content): Generic send handler
  • Return directly from handler instead of returning reply.send() (See Quick Start).