Deft
Ask AI

Search

Search skills, authors and topics

antfu / skills

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.

Install

npx skills add https://github.com/antfu/skills --skill nitro
metadata
author: Anthony Fu version: "2026.9.25" source: Generated from https://github.com/nitrojs/nitro, scripts located at https://github.com/antfu/skills

The skill is based on Nitro v3 (beta, 3.0.260903), generated at 2026-09-25.

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 CORS.
  • Caching layer (cached handlers/functions, SWR) on top of the unstorage KV layer.
  • 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.

Key v3 changes (vs. nitropack v2): the package is renamed nitropack → nitro with H3 v2 (web-standard Request/Response); auto-imports are removed (import everything explicitly); directory scanning is opt-in via serverDir; useStorage → useKV (nitro/kv) and the storage config option → kv; cache swr now defaults to false. If unsure about v2-vs-v3 APIs, read advanced-migration [blocked] first.

Core

TopicDescriptionReference
RoutingFile-based routes, defineHandler, params, middleware, route rules, errorscore-routing [blocked]
Configurationnitro.config.ts, defineConfig, key options, runtime configcore-configuration [blocked]
Storageunstorage KV, mount points, drivers, dynamic mountscore-storage [blocked]
CachedefineCachedHandler, defineCachedFunction, SWR, invalidationcore-cache [blocked]
AssetsPublic assets, compression, server assets via storagecore-assets [blocked]
RenderingRenderer (HTML/SSR), server entry, framework integrationcore-rendering [blocked]

Features

TopicDescriptionReference
Plugins & HooksdefinePlugin, runtime lifecycle hooks, error capturefeatures-plugins [blocked]
TasksOn-demand & scheduled (cron) tasks, runTaskfeatures-tasks [blocked]
WebSocket & SSEdefineWebSocketHandler, pub/sub, namespaces, event streamsfeatures-websocket [blocked]
DatabaseBuilt-in SQL layer via db0, useDatabase, connectorsfeatures-database [blocked]
OpenAPIAuto spec from defineRouteMeta, Scalar/Swagger UIsfeatures-openapi [blocked]

Advanced / Deployment

TopicDescriptionReference
Deployment PresetsRuntimes & providers, compatibility dates, platform integrationdeploy-presets [blocked]
v2 → v3 MigrationPackage rename, nitro/* imports, H3 v2 API, preset changesadvanced-migration [blocked]