Installation
Create a new app with npm create senri, or add Senri to an existing project
Create a new app
npm create senri@latest my-appYou are asked for the runtime (Bun, Node.js, Deno or Cloudflare Workers). When it finishes, it prints the commands to run the app.
cd my-app
npm install
npm run dev # → http://localhost:3927Pass both the folder name and --template to create the app without any questions.
npm create senri@latest my-app -- --template bun--template | Runtime | Start | URL |
|---|---|---|---|
bun | Bun | bun install → bun run dev | http://localhost:3927 |
node | Node.js | npm install → npm run dev | http://localhost:3927 |
deno | Deno | deno task dev | http://localhost:3927 |
workers | Cloudflare Workers | npm install → npm run dev | http://localhost:8787 |
When started with dev, the app restarts when you edit a file.
What you get
The Bun template (--template bun) creates these files.
index.ts
.gitignore
package.json
README.md
tsconfig.json
import { } from "@senrijs/senri";
import { } from "@senrijs/senri/dev";
import { } from "@senrijs/senri/serve";
const = ({ : () });
.("/", () => "Hello, Senri!");
.("/users/:id", ({ }) => ({ }));
();- The Node.js template has the same layout
- The Deno template has
deno.jsoninstead ofpackage.json, and its entry issrc/main.ts - The Cloudflare Workers template writes
export default appinstead ofserve(app), and haswrangler.jsonc
Add Senri to an existing project
npm i @senrijs/senriOn Deno, install it from JSR (deno add jsr:@senrijs/senri in the "deno" tab).
Supported versions
- Node.js: 22 or later. The Node.js template runs TypeScript as is, so it needs 22.18 or later
- Bun and Deno: tested in CI with the latest versions at the time
- Cloudflare Workers: the template's
compatibility_dateis2026-10-01