New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

hono-throw

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hono-throw

A Hono middleware making it easy to throw HTTPException.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

hono-throw

A Hono middleware making it easy to throw HTTPException.

Install

$ npm i hono-throw --save

Example

import { Hono } from 'hono'
import { honoThrow } from 'hono-throw'
import { serve } from '@hono/node-server'

const app = new Hono()
honoThrow(app) // or app.use(honoThrow())

app.get('/', (c) => {
  c.throw(400, 'error!!!')

  // Equivalent to:
  // c.throw(400, { message: 'error!!!' })

  // Equivalent to:
  // throw new HTTPException(400, { message: 'error!!!' })
})

serve(app)

Test(100% coverage rate)

$ npm test

License

MIT

Keywords

hono

FAQs

Package last updated on 09 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts