https://github.com/bit-js/byte
Fast, minimal web framework to create type safe APIs
https://github.com/bit-js/byte
Last synced: 4 months ago
JSON representation
Fast, minimal web framework to create type safe APIs
- Host: GitHub
- URL: https://github.com/bit-js/byte
- Owner: bit-js
- Created: 2024-02-05T16:34:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-03T06:31:55.000Z (7 months ago)
- Last Synced: 2024-08-03T07:36:51.451Z (7 months ago)
- Language: TypeScript
- Homepage: https://bytejs.pages.dev
- Size: 150 KB
- Stars: 69
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Byte
A simple, performance-focused web framework that works on Bun, Deno, and browsers.
```ts
import { Byte } from "@bit-js/byte";export default new Byte().get("/", (ctx) => ctx.body("Hi"));
```## Features
- **Fast**: Internally use [`Blitz`](//www.npmjs.com/package/@bit-js/blitz), the fastest router in the JS ecosystem.
- **Multi-runtime**: Works on all non-edge JS runtimes without any adapters.## Benchmarks
Byte starts up faster than the `hono/quick` preset with LinearRouter.
```
[535.66ms] Byte: Build 1000 routes
[687.44ms] Hono: Build 1000 routes
```Byte matches routes 6x faster than Hono with RegExpRouter.
```
"/user":
- Hono: 23416ns
- Byte: 4463ns"/user/comments":
- Hono: 26255ns
- Byte: 4454ns"/user/avatar":
- Hono: 31863ns
- Byte: 4991ns"/event/:id":
- Hono: 33113ns
- Byte: 7072ns"/event/:id/comments":
- Hono: 34888ns
- Byte: 8257ns"/status":
- Hono: 26211ns
- Byte: 4195ns"/deeply/nested/route/for/testing":
- Hono: 22171ns
- Byte: 3981ns
```See [benchmarks](//github.com/bit-js/byte/tree/main/bench) for more details.
## Docs
See the docs at [bytejs.pages.dev](https://bytejs.pages.dev).