docs: write about Deno
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Yusuke Wada · committed by Yusuke Wada · parent c65e811 · Browse files · 1 file·+51 added−1 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+51 added−1 removed
- other:+51 added−1 removed
Provenance
- Commit
0c8d9ce- Tree
210229f- Author
Yusuke Wada <yusuke@kamawada.com>- Committer
Yusuke Wada <yusuke@kamawada.com>- Parent
c65e811
1 file changed+51 added−1 removed
modified:README.md+51 added-1 removed
30 unmodified lines31 - **Zero-dependencies** - using only Service Worker and Web Standard API.32 - **Middleware** - built-in middleware and ability to extend with your own middleware.33 - **TypeScript** - first-class TypeScript support.34 - **Optimized** - for Cloudflare Workers.35+- **Deno** - support for Deno (Experimental).36 36-## Benchmark37+## Benchmarks38 39+### Cloudflare Workers40+41+- Machine: Apple MacBook Pro, 32 GiB, M1 Pro42+- Scripts: [benchmarks/handle-event](https://github.com/honojs/hono/tree/master/benchmarks/handle-event)43+44 **Hono is fastest**, compared to other routers for Cloudflare Workers.45 46 ```plain47 hono - trie-router(default) x 389,510 ops/sec ±3.16% (85 runs sampled)4 unmodified lines52 Fastest is hono - regexp-router53 ✨ Done in 43.56s.54 ```55 56+### Deno57+58+- Machine: Apple MacBook Pro, 32 GiB, M1 Pro, Deno v1.22.059+- Scripts: [benchmarks/deno](https://github.com/honojs/hono/tree/master/benchmarks/deno)60+- Method: `autocannon -c 100 -d 40 -p 10 'http://127.0.0.1:8000/user/lookup/username/foo'`61+62+**Hono is fastest**, compared to other frameworks for Deno.63+64+| Framework | Version | Results |65+| ----------------------------- | :-----: | ----------------------------------------: |66+| **Hono - RegExpRouter** | 1.6.0 | **5118k requests in 40.02s, 865 MB read** |67+| **Hono - TriRouter(default)** | 1.6.0 | **4932k requests in 40.02s, 833 MB read** |68+| Faster | 5.7 | 3579k requests in 40.02s, 551 MB read |69+| oak | 10.5.1 | 2385k requests in 40.02s, 403 MB read |70+| opine | 2.2.0 | 1491k requests in 40.02s, 346 MB read |71+72 ## Why so fast?73 74 Routers used in Hono are really smart.75 679 unmodified lines755 ## Other Examples756 757 - Hono Examples - <https://github.com/honojs/examples>758 759+## Deno760+761+Hono also works with Deno. This feature is still experimental.762+763+```tsx764+/** @jsx jsx */765+import { serve } from 'https://deno.land/std@0.146.0/http/server.ts'766+import { Hono, logger, poweredBy, basicAuth, jsx } from 'https://deno.land/x/hono/mod.ts'767+768+const app = new Hono()769+770+app.use('*', logger(), poweredBy())771+app.get(772+ '/auth/*',773+ basicAuth({774+ username: 'deno',775+ password: 'isacool',776+ })777+)778+779+app.get('/', (c) => {780+ return c.html(<h1>Hello Deno!</h1>)781+})782+app.get('/auth/abc', (c) => c.text('You are authorized'))783+784+serve(app.fire())785+```786+787 ## Related projects788 789 Implementation of the original router `TrieRouter` is inspired by [goblin](https://github.com/bmf-san/goblin). `RegExpRouter` is inspired by [Router::Boom](https://github.com/tokuhirom/Router-Boom). API design is inspired by [express](https://github.com/expressjs/express) and [koa](https://github.com/koajs/koa). [itty-router](https://github.com/kwhitley/itty-router), [Sunder](https://github.com/SunderJS/sunder), and [worktop](https://github.com/lukeed/worktop) are the other routers or frameworks for Cloudflare Workers.790 29 unmodified lines