


























JSR is a modern JavaScript registry intended to simplify publishing and consuming JavaScript and TypeScript modules, while also moving the ecosystem forward by supporting and promoting web standards. Since its launch, JSR has been well received by the community, with over 250 new packages being published each week.
Today, we’re thrilled to announce that Hono is now available on JSR.
Hono is a fast, lightweight, batteries-included, cross-platform server routing framework that has first class TypeScript and web standard API support.
Using Hono via JSR offers an excellent developer experience, with fully featured documentation and type definitions right in your text editor.
You can get started with Hono from JSR using the following command:
deno add @hono/honoOr using npm:
npx jsr add @hono/honoThe above command will generate a deno.json file, listing all your project
dependencies.
// deno.json
{
"imports": {
"@hono/hono": "jsr:@hono/hono^4.4.5"
}
}You can then import the serverless driver to your main.ts file:
import { Hono } from "@hono/hono"; const app = new Hono(); app.get("/", (c) => { return c.text("Hello Deno!"); }); Deno.serve(app.fetch);
Finally, you can run the following command to execute:
deno run -A main.tsNote, you can also scaffold your Hono project with the following command:
deno run -A npm:create-hono@latestCurrently, only the deno template selection will use Hono from JSR.
With Hono on JSR, you can build a lightweight, fast server with API routes that can run in any JavaScript environment. Your text editor will pull in type definitions and relevant documentation so that you can be more productive.
🚨️ Read more about JSR 🚨️
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。