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

@honorer/core

v0.1.6

Published

Module-first toolkit for Hono with decorators, DI, Zod validation, and response helpers.

Readme

@honorer/core

A small toolkit around Hono that adds TypeScript decorators, Zod-powered validation, lightweight DI, a module system, and response helpers for building clean HTTP APIs.

Features

  • Decorator-based controllers and routes (@Controller, @Get, @Post, ...)
  • Zod validation for route params, query, and body (@Params, @Query, @Body)
  • Simple dependency injection (@Injectable, @Inject)
  • Module system with dependency-aware registration (@Module + createModularApp)
  • Consistent response envelope (ApiResponse) and result normalization (formatReturn)

Install

  • In a generated app: already included
  • Standalone: pnpm add @honorer/core hono

Quick Start (Controllers)

import { serve } from '@hono/node-server'
import { createApp, Controller, Get } from '@honorer/core'
import type { Context } from 'hono'

@Controller('/users')
class UsersController {
  @Get('/')
  list(c: Context) {
    return c.json([{ id: '1', name: 'Ada' }])
  }
}

// Register legacy controllers (object config)
const app = createApp({ controllers: [UsersController] })
serve({ fetch: app.fetch, port: 3001 })

Module-First Usage

import { createModularApp, Module, Injectable, Controller, Get } from '@honorer/core'
import type { Context } from 'hono'

@Injectable()
class UsersService {
  findAll() { return [{ id: '1', name: 'Ada' }] }
}

@Controller('/users')
class UsersController {
  constructor(private svc: UsersService) {}
  @Get('/')
  list(c: Context) { return c.json(this.svc.findAll()) }
}

@Module({
  providers: [UsersService],
  controllers: [UsersController],
})
class AppModule {}

const app = await createModularApp({ modules: [AppModule] })

Validation with Zod

import { z } from 'zod'
import { Controller, Get, Params, Query, Body } from '@honorer/core'
import type { Context } from 'hono'

const UserParams = z.object({ id: z.string().uuid() })
const ListQuery = z.object({ page: z.coerce.number().int().min(1).default(1) })
const CreateBody = z.object({ name: z.string(), email: z.string().email() })

@Controller('/users')
class UsersController {
  @Get('/:id')
  get(@Params(UserParams) p: z.infer<typeof UserParams>, c: Context) {
    return c.json({ id: p.id })
  }

  @Get('/')
  list(@Query(ListQuery) q: z.infer<typeof ListQuery>, c: Context) {
    return c.json({ page: q.page, items: [] })
  }

  @Get('/create')
  async create(@Body(CreateBody) body: z.infer<typeof CreateBody>, c: Context) {
    return c.json({ created: body })
  }
}
  • Helpers: paramsOf(c, schema), queryOf(c, schema), bodyOf(c, schema) to fetch parsed data manually.
  • Invalid input automatically returns a 400 with details via ZodError handling.

Dependency Injection

import { Injectable, Inject } from '@honorer/core'

@Injectable()
class UsersService { findAll() { return [{ id: '1' }] } }

class UsersController {
  constructor(@Inject(UsersService) private svc: UsersService) {}
}

Responses

  • Return plain values, Response, or ApiResponse.success/error/paginatedformatReturn normalizes for consistency.
  • Errors thrown as HTTPException or ZodError are mapped to ApiResponse.error.
import { ApiResponse } from '@honorer/core'

return ApiResponse.success({ data: { id: '1' } })

Configuration

  • createHonorerApp({ formatResponse?: boolean; debug?: boolean; errorHandler?: (err, c) => Response })
  • createApp({ options, controllers, providers, modules }) registers legacy controllers and can also kick off module registration.
  • createModularApp({ options, modules, controllers?, providers? }) prefers modules first.

Notes on Type Generation

  • The previous type generator and .honorer output have been removed. No generator configuration or type emission is performed by the core.

Requirements

  • Node >=20.6 recommended (works with >=18.19)
  • TypeScript with decorators: enable experimentalDecorators and emitDecoratorMetadata
  • Hono ^4

See Also

  • Scaffold a new app: npx create-honorer-app my-app or pnpm dlx create-honorer-app my-app
  • Example app in this repo: apps/example