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

@danielgl/steampunk

v1.0.0

Published

A high-performance, DX-focused web framework for Bun, inspired by ASP.NET Core.

Readme

Features

  • Dependency Injection: Powerful ServiceCollection and ServiceProvider out of the box (Singleton, Scoped, Transient).
  • Builder Pattern: Familiar WebApplication.createBuilder() approach.
  • Decorators: Beautiful Controller and Routing decorators (@Controller(), @Get(), @Post(), @FromRoute(), etc).
  • Extremely Fast: Built natively on top of Bun.serve().

Installation

bun add @danielgl/steampunk reflect-metadata

Ensure your tsconfig.json has experimentalDecorators and emitDecoratorMetadata enabled:

{
    "compilerOptions": {
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true
    }
}

Quick Start

1. Create a Service

import { Injectable } from "@danielgl/steampunk";

export interface User {
    id: string;
    name: string;
}

@Injectable()
export class UsersService {
    private users: User[] = [{ id: "1", name: "Alice" }];

    public getAll() {
        return this.users;
    }
    public getById(id: string) {
        return this.users.find((u) => u.id === id);
    }
}

2. Create a Controller

import { Controller, Get, FromRoute, HttpResult } from "@danielgl/steampunk";
import { UsersService } from "./users-service";
import type { User } from "./users-service";

@Controller("users")
export class UsersController {
    // Services are automatically injected!
    constructor(private usersService: UsersService) {}

    @Get()
    public getAllUsers(): HttpResult {
        const users = this.usersService.getAll();
        return HttpResult.ok(users);
    }

    @Get(":id")
    public getUserById(@FromRoute("id") id: string): HttpResult {
        const user = this.usersService.getById(id);
        if (!user) {
            return HttpResult.notFound("User not found");
        }
        return HttpResult.ok(user);
    }
}

3. Bootstrap your App

import { WebApplication } from "@danielgl/steampunk";
import { UsersService } from "./users-service";
import { UsersController } from "./users-controller";

const builder = WebApplication.createBuilder();

// 1. Register DI Services
builder.services.addSingleton(UsersService);

const app = builder.build();

// 2. Add Middlewares
app.use(async (context, next) => {
    console.log(`[${context.method}] ${context.path}`);
    return next();
});

// 3. Map Controllers
app.mapControllers([UsersController]);

### 4. Run!

```bash
bun run main.ts

Response Helpers (HttpResult)

Steampunk provides a powerful HttpResult class to simplify returning HTTP responses.

// Return 200 OK with an object (auto-serialized to JSON)
return HttpResult.ok({ id: 1, name: "John" });

// Return 201 Created with a Location header
return HttpResult.created(newUser, `/users/${newUser.id}`);

// Return 400 Bad Request with a message
return HttpResult.badRequest("Invalid input");

// Return 404 Not Found
return HttpResult.notFound("User not found");

All methods support flexible payloads: string, object, or array.

Authentication & Authorization

Protect your routes easily using the @Authorize() decorator.

@Authorize() // Multi-level: Class or Method
@Controller("admin")
export class AdminController {
    @Get("secret")
    public getSecret() {
        return HttpResult.ok("shhh!");
    }
}

Development

Available scripts for contributing or local development:

  • bun run lint: Run ESLint checks.
  • bun run format: Format code with Prettier.
  • bun run test: Run unit tests with Bun.

Pre-commit hooks are enforced via Husky to ensure code quality!

Made with ❤️ focusing on Developer Experience.