Nitro (framework)
js, serverless, edge, or static — from a single codebase.
Definition
Nitro is an open-source, universal server toolkit and web framework maintained by the Nuxt/UnJS team that builds JavaScript/TypeScript server applications capable of deploying to virtually any hosting target — Node.js, serverless, edge, or static — from a single codebase.
Overview
Nitro emerged from the Nuxt ecosystem as the server engine powering Nuxt 3's server-side rendering and API routes, but it was designed and released as a standalone, framework-agnostic toolkit that can be used independently of Nuxt for building any kind of server application, API, or full-stack backend in JavaScript or TypeScript. Its defining feature is a build-time deployment adapter system: the same application code can be compiled to run as a traditional Node.js server, a serverless function (AWS Lambda, Vercel, Netlify), an edge worker (Cloudflare Workers, Deno Deploy), or even pre-rendered as static output, simply by changing a build target configuration rather than rewriting application code for each platform. Under the hood, Nitro provides file-based routing for API endpoints, automatic code-splitting and tree-shaking to keep bundle sizes minimal for serverless/edge deployment, a built-in storage layer abstraction (unstorage) that works across drivers like Redis, filesystem, and cloud KV stores, and hot module reloading during development. Nitro also includes a universal fetch-based request/response model and middleware system, along with caching utilities and route rules that let developers declaratively configure caching, redirects, and rendering behavior per route. While most developers encounter Nitro indirectly as the engine inside Nuxt applications, it's increasingly used standalone for building lightweight, portable backend APIs and BFF (backend-for-frontend) layers that need to be deployable across multiple hosting providers without vendor lock-in. Its "write once, deploy anywhere" philosophy addresses a common pain point in modern web development, where teams often want the flexibility to move between Vercel, Cloudflare, AWS, or a traditional Node server without rewriting server logic for each platform's specific runtime API.
Key Features
- Universal deployment adapters targeting Node.js, serverless, edge, and static hosts
- File-based routing for defining API endpoints
- Automatic code-splitting and tree-shaking for minimal serverless/edge bundle size
- Built-in unstorage abstraction supporting Redis, filesystem, and cloud KV drivers
- Fetch-based universal request/response and middleware model
- Declarative route rules for caching, redirects, and rendering behavior
- Powers the Nuxt 3 server engine but usable fully standalone
- Hot module reloading and fast development server experience