Skip to Content
Senri

What is Senri

A small web framework written only with the web-standard Request and Response

Senri is a small web framework written only with the web-standard Request and Response. The same code runs on Bun, Node.js, Deno, Cloudflare Workers and the browser (Service Worker).

import {  } from "@senrijs/senri";
import {  } from "@senrijs/senri/dev";
import {  } from "@senrijs/senri/serve";

const  = ({ : () });

.("/hello", () => "Hello");                // string → text/plain
.("/users/:id", ({ id }) => ({  }));    // object → JSON
id: string
await (); // on Bun, Node.js and Deno

Features

  • What you return becomes the response. A string becomes text and an object becomes JSON. You can also return a Response as is
  • Types come from the path. Write /users/:id and the handler's id is typed. You can check parameters, the query and the body with Standard Schema (Zod, Valibot, ArkType and others)
  • A helpful development mode. Error pages show the code where the error happened and hints. 404 pages show "did you mean". The /_senri dashboard shows how each request went through the middleware
  • Runs anywhere. It uses only web-standard APIs, with no eval and no new Function
  • Small. A minimal app bundles to about 7 KB after gzip. The development-mode code does not go into production builds

On this page