Packages

hono

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

Your version

3.3.0

11 Jul 2023Where it was published

3.12.12 is the newest release of 3.x.

In short

3 new3 fixed3 internal

Security

44 advisories affect 3.3.0; 4.13.16 fixes them

39 more

Release note

v3.3.0 is now available. This release includes two new features. Let's explore them.

Server-Timing Middleware

Performance measurement is important. We're introducing the Server-Timing Middleware. This middleware allows you to measure the performance of processes in handlers using the Server-Timing API.

import { Hono } from 'hono'
import { endTime, setMetric, startTime, timing } from 'hono/timing'

const app = new Hono()

app.use('*', timing())

app.get('/', async (c) => {
  // add custom metrics
  setMetric(c, 'region', 'europe-west3')

  // add custom metrics with timing, must be in milliseconds
  setMetric(c, 'custom', 23.8, 'My custom Metric')

  // start a new timer
  startTime(c, 'db')
  const data = ['foo'] // DB process
  endTime(c, 'db')

  return c.json({ response: data })
})

export default app

You can view the results in tools like Chrome DevTools.

SS

Lambda@Edge Adapter (Experimental)

We already have an AWS Lambda adapter, but it did not support Lambda@Edge. Now, the Lambda@Edge Adapter is available, although it's experimental. It's easy to use.

import { Hono } from 'hono'
import { handle } from 'hono/lambda-edge'

const app = new Hono()

app.get('/', (c) => c.text('Hello Hono!'))

export const handler = handle(app)

If you want to add Basic Auth and continue with request processing after verification, you can use c.env.callback()

import { Callback, CloudFrontRequest, handle } from 'hono/lambda-edge'

type Bindings = {
  callback: Callback
  request: CloudFrontRequest
}

const app = new Hono<{ Bindings: Bindings }>()

app.get(
  '*',
  basicAuth({
    username: 'a',
    password: 'b'
  })
)

app.get('/index.html', async (c, next) => {
  await next()
  c.env.callback(null, c.env.request)
})

export const handler = handle(app)

Special thanks to @watany-dev for this feature!

All Updates

  • Fix replaceUrlParam to ignore regexp in path

  • Add Server-Timing API as middleware

  • adapter: AWS Lambda Adapter supports requests via Lambda@edge

  • mount: Include query params

  • lambda-edge: Update schema and refactor

  • lambda-edge: Pass the context and callback as env

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.