All skills
onmax avatar

/nitro

@de09c7b official
by Maxonmax/nuxt-skills715 stars
38

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.

Use this Skill: https://skilld.dev/gh/onmax/nuxt-skills/nitro

This session only. Nothing lands on disk.

referencescore-assets.md

≈770 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Assets

Nitro handles two asset kinds: public assets served directly to clients, and server assets bundled into the server for programmatic access.

Public assets

Files in public/ are served automatically at the matching URL.

public/
  image.png    -> /image.png
  robots.txt   -> /robots.txt
  • Served with automatic ETag / Last-Modified and 304 Not Modified support.
  • In production, public/ is copied to .output/public/ and a metadata manifest is embedded for fast lookups + caching headers.

Custom public directories

import { defineConfig } from "nitro";

export default defineConfig({
  publicAssets: [
    {
      baseURL: "build",       // served under /build/
      dir: "public/build",    // source on disk
      maxAge: 3600,           // Cache-Control: public, max-age=3600, immutable
    },
  ],
});

Other entry options: fallthrough (continue to handlers when not found; defaults true for root, false otherwise) and ignore.

Pre-compression

Generate gzip/brotli/zstd variants at build time, served based on Accept-Encoding:

export default defineConfig({
  compressPublicAssets: true, // or { gzip: true, brotli: true, zstd: false }
});

Only compressible MIME types ≥ 1 KB are compressed (.map files excluded).

Server assets

Files in assets/ are bundled into the server and read via the storage layer at the assets:server mount point (only included in the bundle when accessed through useStorage).

assets/
  data.json
  templates/welcome.html
import { defineHandler } from "nitro";
import { useStorage } from "nitro/storage";

export default defineHandler(async () => {
  const serverAssets = useStorage("assets:server");
  const keys = await serverAssets.getKeys();
  const data = await serverAssets.getItem("data.json");
  const meta = await serverAssets.getMeta("data.json"); // { type, etag, mtime }
  return { keys, data, meta };
});

Custom server asset directories

import { defineConfig } from "nitro";

export default defineConfig({
  serverAssets: [
    { baseName: "templates", dir: "./templates" },
  ],
});

Access via the assets:templates mount:

const html = await useStorage("assets:templates").getItem("email.html");

Entry options: baseName, dir, pattern (default **/*), ignore.

Key Points

  • public/ → served to clients with ETag/compression; assets/ → bundled, read via useStorage("assets:server").
  • Server assets are only bundled if referenced through useStorage.
  • In dev, server assets read from the filesystem; in production they are inlined with precomputed metadata.
  • Use publicAssets[].maxAge and compressPublicAssets to offload caching/compression without a CDN.
<!-- Source references: - https://nitro.build/docs/assets - https://nitro.build/docs/storage#server-assets -->

Source: SKILL.md on GitHub

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    The Nitro skill provides comprehensive documentation for building and deploying web servers using the Nitro framework. It covers routing, configuration, storage, caching, database integration, and deployment presets. The skill is informative and describes standard web framework features and best practices.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at de09c7b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated last week
Other metadata
metadata
{
  "author": "Anthony Fu",
  "version": "2026.6.22",
  "source": "Generated from https://github.com/nitrojs/nitro, scripts located at https://github.com/antfu/skills"
}

README badge

README badge for onmax/nuxt-skills/nitro