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

@timdehof/honoforge

v0.2.3

Published

Forge type-safe APIs at the speed of flame.

Readme

@timdehof/honoforge

Forge type-safe APIs at the speed of flame.

A collection of utilities for the Hono ecosystem — OpenAPI schema conversion, route metadata extraction, and RFC 9457 Problem Details error handling.

Installation

npm install @timdehof/honoforge

Peer dependencies:

  • hono >= 4.10.0
  • zod ^3.25.0 || ^4.0.0 (optional)
  • @hono/zod-openapi >= 1.4.0 (optional)

Usage

Core

import type { ForgeEnv, ForgeMiddlewareHandler, ForgeStorage } from "@timdehof/honoforge";

import { HttpStatusCode } from "@timdehof/honoforge";

// Typed HTTP status codes
HttpStatusCode.OK; // 200
HttpStatusCode.NOT_FOUND; // 404
HttpStatusCode.INTERNAL_SERVER_ERROR; // 500

// Type infrastructure for Hono middleware
type AppEnv = ForgeEnv & {
  Variables: { user: User };
};

const authMiddleware: ForgeMiddlewareHandler<AppEnv> = async (c, next) => {
  const user = await authenticate(c.req.header("Authorization"));
  c.set("user", user);
  await next();
};

OpenAPI (@timdeof/honoforge/openapi)

import { z } from "zod";

import { extractRouteMetadata, generateOpenAPIDoc, zodToOpenAPI } from "@timdehof/honoforge/openapi";

// Convert Zod schemas to OpenAPI 3.x
const schema = z.object({
  id: z.string(),
  name: z.string(),
  email: z.string().email(),
});

const openapiSchema = zodToOpenAPI(schema);
// { type: 'object', properties: { id: { type: 'string' }, ... }, required: ['id', 'name', 'email'] }

// Route metadata extraction
const routes = extractRouteMetadata(app);

// OpenAPI document generation
const doc = generateOpenAPIDoc(app, {
  title: "My API",
  version: "1.0.0",
});

Middleware (@timdehof/honoforge/middleware)

import { createErrorHandler, formatError } from "@timdehof/honoforge/middleware";

// Global error handling (recommended)
const app = new Hono();
app.onError(createErrorHandler());

// Manual error formatting
const problem = formatError(new Error("Something went wrong"));
// { type: 'about:blank', title: 'Error', status: 500, detail: 'Something went wrong' }

// Production mode — sanitizes 5xx error details
app.onError(createErrorHandler({ isProduction: true }));

Subpath Exports

| Import | Description | | -------------------------------- | ------------------------------------------------------- | | @timdehof/honoforge | Core: HTTP status codes, types, storage interface | | @timdehof/honoforge/openapi | OpenAPI schema conversion, route metadata, docs helpers | | @timdehof/honoforge/middleware | RFC 9457 error handler, error formatting utilities |

Features

  • Zero runtime overhead — type-level utilities with minimal runtime code
  • Dual ESM/CJS — works in Node.js, Bun, and Cloudflare Workers
  • TypeScript-first — full type inference with Hono's type system
  • RFC 9457 compliant — Problem Details error responses (application/problem+json)
  • OpenAPI 3.x — Zod-to-OpenAPI conversion supporting 25+ Zod types

License

MIT