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

primdy

v0.1.3

Published

Blazingly fast, file-system routed API framework

Readme

Primdy

Blazingly fast, file-system routed API framework optimized for Bun.

bunx create-primdy-app@latest
# or
npx create-primdy-app@latest

Installation

bun add primdy
# or
npm install primdy

Quickstart

Create a route by adding a route.ts file under src/ (or whatever src you configure) and exporting an HTTP method handler:

// src/route.ts
export async function GET() {
  return Response.json({ ok: true });
}

Start the dev server:

primdy dev

That's it! You can now make a request to http://localhost:3000/ and expect {"ok": true}.

Routing

Routes are defined by route.ts files. Each exported HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) becomes a handler for that method.

The syntax is the same as Next.js's API routes in App Router, with the exception that you return Response instead of NextResponse:

// src/users/[id]/route.ts
export async function GET(
  request: Request,
  { params }: { params: { id: string } },
) {
  return Response.json({ id: params.id });
}

Catch-all and optional catch-all segments also produce a string[] param instead of a string:

// src/docs/[...slug]/route.ts
export async function GET(
  request: Request,
  { params }: { params: { slug: string[] } },
) {
  return Response.json({ slug: params.slug });
}

Middleware

Use a middleware.ts or proxy.ts file to run code before every route in that directory. Export a default, middleware, or proxy function:

// src/users/proxy.ts
export function proxy(request: Request) {
  const auth = request.headers.get("authorization");
  if (!auth) {
    return Response.json({ error: "Unauthorized" }, { status: 401 });
  }
}

Helpers

For convenience, primdy exports few helper functions for creating responses:

import { json, text, redirect } from "primdy";

json({ hello: "world" });
text("hello");
redirect("/auth");

Cookies

import { cookies, setCookie, deleteCookie } from "primdy";

export async function GET(request: Request) {
  const theme = cookies(request).get("theme")?.value ?? "light";
  const response = Response.json({ theme });
  return setCookie(response, "theme", theme, { path: "/", httpOnly: true });
}

Configuration

Create a primdy.config.ts at your project root:

import type { PrimdyConfig } from "primdy";

export default {
  src: "src",
  port: 3000,
  hostname: "localhost",
  node: false,
} satisfies PrimdyConfig;

CLI

primdy dev
primdy build
primdy start
primdy analyze

Production builds

In production, you probably want to serve primdy start instead of primdy dev. Use primdy build to bundle your application first!