Packages

hono

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

Your version

2.5.0

7 Nov 2022Where it was published

2.7.8 is the newest release of 2.x.

In short

3 new4 fixed1 internal

Security

44 advisories affect 2.5.0; 4.13.16 fixes them

39 more

Release note

Summary

There are three new features. All of them are useful to you.

1. c.runtime

You can know which runtime the code is running on with c.runtime. This is implemented by @yujong-lee. Thanks!

app.get('/which-runtime/*', (c) => {
  return c.text(`You are on ${c.runtime}!`)
})

2. app.showRoutes()

The app.showRoutes() shows the routes which are registered.

3. app.on()

The app.on() function will enable us set the custom HTTP method as we like:

app.on('PURGE', '/foo', async (c) => {
  await purgeCache('foo')
  return c.redirect('/')
})

What's Changed

  • context: Introducing c.runtime

  • type: Make compatibility with @cloudflare/workers-types

  • context: Check cloudflare before checking node in c.runtime

  • error: Make notFound() enables to catch errors correctly

  • app: Introduce app.showRoutes()

  • app: Introduce app.on(method, path, handler)

  • types: Export ErrorHandler and NotFoundHandler

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.