@nifrajs/deno
v3.1.0
Published
Run a nifra app on Deno via Deno.serve - graceful stop() + opt-in signals.
Maintainers
Readme
@nifrajs/deno
Run a nifra app on Deno via Deno.serve.
deno add npm:@nifrajs/deno # or import npm:@nifrajs/deno directlyimport { server } from "@nifrajs/core/server"
import { serve } from "@nifrajs/deno"
const app = server().get("/users/:id", (c) => ({ id: c.params.id }))
const running = await serve(app, { port: 3000 })
// running.port → the bound port (resolved; useful with `port: 0`)
// await running.stop() → drain in-flight (Deno's shutdown()), then force-closeBecause Deno.serve's handler already speaks Web Request/Response, the app's fetch
is the handler - there's no stream bridge (unlike @nifrajs/node). This adapter just adds
a Bun-listen()-style graceful stop() and opt-in signals.
Graceful shutdown on signals
await serve(app, { port: 3000, signals: true }) // SIGTERM/SIGINT → graceful stop()What you get for free
The request timeout (server({ requestTimeoutMs }) → 503 request_timeout) and body-size
cap live inside app.fetch, so they apply through this adapter automatically.
Works with any { fetch(req): Promise<Response> } handler, not just nifra. ESM/TS. MIT.
For AI agents
Start with LLM.md - this package's contract card (the exports you call + its footguns),
one cheap read instead of the whole corpus. For the wider framework: the repo's
AGENTS.md is the copy-paste quick reference, and
llms-full.txt is the full machine-readable corpus. Run nifra check as the
done-gate, or nifra mcp to give the agent live project tools.
