nitro
Nitro is the framework-agnostic server toolkit (powering Nuxt) for building and deploying web servers anywhere. Use when working with nitro.config, server routes/event handlers, route rules, caching, storage, tasks, websockets, or deploying to Node/Bun/Deno/Cloudflare/Vercel.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- nitro
- metadata
- { "author": "Anthony Fu", "source": "Generated from https://github.com/nitrojs/nitro, scripts located at https://github.com/antfu/skills", "version": "2026.6.22" }
- description
- Nitro is the framework-agnostic server toolkit (powering Nuxt) for building and deploying web servers anywhere. Use when working with nitro.config, server routes/event handlers, route rules, caching, storage, tasks, websockets, or deploying to Node/Bun/Deno/Cloudflare/Vercel.
02 资源文件 14
- 参考文档GENERATION.md135 B
- 参考文档references/advanced-migration.md4.4 KB
- 参考文档references/core-assets.md3.0 KB
- 参考文档references/core-cache.md4.6 KB
- 参考文档references/core-configuration.md4.5 KB
- 参考文档references/core-rendering.md4.0 KB
- 参考文档references/core-routing.md6.3 KB
- 参考文档references/core-storage.md3.3 KB
- 参考文档references/deploy-presets.md3.8 KB
- 参考文档references/features-database.md3.2 KB
- 参考文档references/features-openapi.md3.5 KB
- 参考文档references/features-plugins.md3.6 KB
- 参考文档references/features-tasks.md3.4 KB
- 参考文档references/features-websocket.md3.7 KB
03 SKILL.md 正文
The skill is based on Nitro v3 (beta), generated at 2026-06-22.
Nitro is a framework-agnostic, deployment-agnostic server toolkit powered by H3 v2, unstorage, and Vite/Rolldown/Rollup. It powers Nuxt and works standalone. From one codebase it builds optimized output for Node.js, Bun, Deno, Cloudflare, Vercel, Netlify, and more.
Key capabilities:
- Filesystem routing with H3 v2 event handlers, dynamic params, and method suffixes.
- Route rules for declarative caching, headers, redirects, proxying, and auth.
- Caching layer (cached handlers/functions, SWR) on top of unstorage KV.
- Runtime config overridable via
NITRO_*env vars. - Tasks (on-demand + scheduled/cron), WebSockets/SSE, a SQL database layer, and OpenAPI auto-docs.
- Plugins & lifecycle hooks, custom renderer/server entry, and portable deployment presets.
Nitro v3 renamed the package
nitropack→nitroand adopts H3 v2 (web-standardRequest/Response). If unsure about v2-vs-v3 APIs, read advanced-migration first.
Core
| Topic | Description | Reference |
|---|---|---|
| Routing | File-based routes, defineHandler, params, middleware, route rules, errors |
core-routing |
| Configuration | nitro.config.ts, defineConfig, key options, runtime config |
core-configuration |
| Storage | unstorage KV, mount points, drivers, dynamic mounts | core-storage |
| Cache | defineCachedHandler, defineCachedFunction, SWR, invalidation |
core-cache |
| Assets | Public assets, compression, server assets via storage | core-assets |
| Rendering | Renderer (HTML/SSR), server entry, framework integration | core-rendering |
Features
| Topic | Description | Reference |
|---|---|---|
| Plugins & Hooks | definePlugin, runtime lifecycle hooks, error capture |
features-plugins |
| Tasks | On-demand & scheduled (cron) tasks, runTask |
features-tasks |
| WebSocket & SSE | defineWebSocketHandler, pub/sub, namespaces, event streams |
features-websocket |
| Database | Built-in SQL layer via db0, useDatabase, connectors |
features-database |
| OpenAPI | Auto spec from defineRouteMeta, Scalar/Swagger UIs |
features-openapi |
Advanced / Deployment
| Topic | Description | Reference |
|---|---|---|
| Deployment Presets | Runtimes & providers, compatibility dates, platform integration | deploy-presets |
| v2 → v3 Migration | Package rename, nitro/* imports, H3 v2 API, preset changes |
advanced-migration |
04 同仓库更多 Skills
web-perf
Audit, diagnose, or optimize website loading and interaction performance, Core Web Vitals, and Lighthouse performance scores.
unlighthouse
Run Google Lighthouse on every page of a site with the unlighthouse CLI, and fail CI on low scores with unlighthouse-ci. Use when a task mentions unlighthouse, unlighthouse-ci, site-wide Lighthouse scans, performance budgets in CI, unlighthouse.config.ts, defineUnlighthouseConfig, scanner.exclude, dynamic sampling, the authenticate hook, or a scan that never exits, skips pages, or refuses to clear its output folder.
performance-optimization
Optimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.
fixing-accessibility
Audit and fix HTML accessibility issues including ARIA labels, keyboard navigation, focus management, color contrast, and form errors. Use when adding interactive controls, forms, dialogs, or reviewing WCAG compliance.
better-accessibility
Reviews and fixes keyboard and focus behavior, ARIA, accessible names, forms, screen-reader announcements, motion and zoom in your project against WCAG 2.2.
web-perf
Audit, diagnose, or optimize website loading and interaction performance, Core Web Vitals, and Lighthouse performance scores.