Packages

hono

4.13.19 · 16 Nov 2026MIT113.6M / weekRepositoryHomepagenpmAtom feed

Your version

2.3.2

24 Oct 2022Where it was published

2.7.8 is the newest release of 2.x.

In short

1 new2 fixed4 internal

Security

44 advisories affect 2.3.2; 4.13.16 fixes them

39 more

Release note

Summary

Fixed a bug related to the Validator and added a minor feature.

The Validator type is exported. You can write your schema definition outside the middleware handler as follows:

import type { Validator } from 'hono'
import { validator } from 'hono/validator'

const schema = (v: Validator) => ({
  query: v.query('query').isRequired(),
  page: v.query('page').isNumeric().isOptional(),
})

app.get('/search', validator(schema), (c) => {
  const { query, page } = c.req.valid()
  //...
  return c.text('Result!!')
})

Validator and validator are similar and confusing, but if you don't like it, just use an alias.

What's Changed

  • validator: Make "isOptional" work correctly with "value" validation

  • deno: Export static-router and smart-router

  • validator: Export Validator from 'hono'

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.