Comparing version 1.6.0-0 to 1.6.0
{ | ||
"name": "hono", | ||
"version": "1.6.0-0", | ||
"version": "1.6.0", | ||
"description": "Ultrafast web framework for Cloudflare Workers.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -35,5 +35,11 @@ <div align="center"> | ||
- **Optimized** - for Cloudflare Workers. | ||
- **Deno** - support for Deno (Experimental). | ||
## Benchmark | ||
## Benchmarks | ||
### Cloudflare Workers | ||
- Machine: Apple MacBook Pro, 32 GiB, M1 Pro | ||
- Scripts: [benchmarks/handle-event](https://github.com/honojs/hono/tree/master/benchmarks/handle-event) | ||
**Hono is fastest**, compared to other routers for Cloudflare Workers. | ||
@@ -51,2 +57,18 @@ | ||
### Deno | ||
- Machine: Apple MacBook Pro, 32 GiB, M1 Pro, Deno v1.22.0 | ||
- Scripts: [benchmarks/deno](https://github.com/honojs/hono/tree/master/benchmarks/deno) | ||
- Method: `autocannon -c 100 -d 40 -p 10 'http://127.0.0.1:8000/user/lookup/username/foo'` | ||
**Hono is fastest**, compared to other frameworks for Deno. | ||
| Framework | Version | Results | | ||
| ----------------------------- | :-----: | ----------------------------------------: | | ||
| **Hono - RegExpRouter** | 1.6.0 | **5118k requests in 40.02s, 865 MB read** | | ||
| **Hono - TriRouter(default)** | 1.6.0 | **4932k requests in 40.02s, 833 MB read** | | ||
| Faster | 5.7 | 3579k requests in 40.02s, 551 MB read | | ||
| oak | 10.5.1 | 2385k requests in 40.02s, 403 MB read | | ||
| opine | 2.2.0 | 1491k requests in 40.02s, 346 MB read | | ||
## Why so fast? | ||
@@ -739,2 +761,30 @@ | ||
## Deno | ||
Hono also works with Deno. This feature is still experimental. | ||
```tsx | ||
/** @jsx jsx */ | ||
import { serve } from 'https://deno.land/std@0.146.0/http/server.ts' | ||
import { Hono, logger, poweredBy, basicAuth, jsx } from 'https://deno.land/x/hono/mod.ts' | ||
const app = new Hono() | ||
app.use('*', logger(), poweredBy()) | ||
app.get( | ||
'/auth/*', | ||
basicAuth({ | ||
username: 'deno', | ||
password: 'isacool', | ||
}) | ||
) | ||
app.get('/', (c) => { | ||
return c.html(<h1>Hello Deno!</h1>) | ||
}) | ||
app.get('/auth/abc', (c) => c.text('You are authorized')) | ||
serve(app.fire()) | ||
``` | ||
## Related projects | ||
@@ -741,0 +791,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
135113
0
820