Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hono

Package Overview
Dependencies
Maintainers
1
Versions
338
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hono - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

src/middleware.test.js

2

package.json
{
"name": "hono",
"version": "0.0.7",
"version": "0.0.8",
"description": "Minimal web framework for Cloudflare Workers and Fastly Compute@Edge",

@@ -5,0 +5,0 @@ "main": "src/hono.js",

@@ -105,3 +105,16 @@ # Hono

### Builtin Middleware
```js
const { Hono, Middleware } = require('hono')
...
app.use('*', Middleware.poweredBy)
```
### Custom Middleware
```js
const logger = (c, next) => {

@@ -117,4 +130,4 @@ console.log(`[${c.req.method}] ${c.req.url}`)

app = app.use('*', logger)
app = app.use('/message/*', addHeader)
app.use('*', logger)
app.use('/message/*', addHeader)

@@ -121,0 +134,0 @@ app.get('/message/hello', () => 'Hello Middleware!')

@@ -42,2 +42,7 @@ declare class FetchEvent {}

export class Middleware {}
// XXX
declare interface BuiltinMiddleware {}
export class Middleware {
static poweredBy: BuiltinMiddleware
}

@@ -1,3 +0,7 @@

class Middleware {}
const poweredBy = require('./middleware/poweredBy')
function Middleware() {}
Middleware.poweredBy = poweredBy
module.exports = Middleware
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc