nitropack

nitropack (Nitro) is the universal server engine expert that supports Nuxt, Analog, and SolidStart. Use it to build portable server applications with file-based routing, auto-imports, server middleware, storage abstractions, caching, and WebSocket support, and deploy to 20+ platforms (e.g. Node.js, Deno, Bun, Cloudflare Workers, Vercel, Netlify, AWS Lambda) without configuration changes.

Last repository push
GitHub Stars
219
Forks
38
Issues / PRs
7

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "nitropack" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-c9ed19b89bec9f0a66b23878f7ca798542be525a09b1d0378b56a170b5246697. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

nitropack (Nitro) is the universal server engine expert that supports Nuxt, Analog, and SolidStart. Use it to build portable server applications with file-based routing, auto-imports, server middleware, storage abstractions, caching, and WebSocket support, and deploy to 20+ platforms (e.g. Node.js, Deno, Bun, Cloudflare Workers, Vercel, Netlify, AWS Lambda) without configuration changes.

0 Downloads

Introduction source: third_party · TerminalSkills · 1.0.0 Reference

SkillPi interpretation

Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: nitropack
description: >-
  You are an expert in Nitro (NitroJS), the universal server engine powering
  Nuxt, Analog, and SolidStart. You help developers build portable server
  applications with file-based routing, auto-imports, server middleware,
  storage abstraction, caching, WebSocket support, and deployment to 20+
  platforms (Node.js, Deno, Bun, Cloudflare Workers, Vercel, Netlify, AWS
  Lambda) — with zero configuration changes between environments.
license: Apache-2.0
compatibility: ''
metadata:
  author: terminal-skills
  version: 1.0.0
  category: Backend Development
  tags:
    - server
    - universal
    - runtime
    - node
    - deno
    - bun
    - edge
    - h3

Nitro — Universal Server Engine

You are an expert in Nitro (NitroJS), the universal server engine powering Nuxt, Analog, and SolidStart. You help developers build portable server applications with file-based routing, auto-imports, server middleware, storage abstraction, caching, WebSocket support, and deployment to 20+ platforms (Node.js, Deno, Bun, Cloudflare Workers, Vercel, Netlify, AWS Lambda) — with zero configuration changes between environments.

Core Capabilities

Server Routes

// server/routes/users/[id].get.ts — File-based API routes
export default defineEventHandler(async (event) => {
  const id = getRouterParam(event, "id");
  const user = await useStorage("db").getItem(`users:${id}`);
  if (!user) throw createError({ statusCode: 404, message: "User not found" });
  return user;
});

// server/routes/users.post.ts
export default defineEventHandler(async (event) => {
  const body = await readBody(event);
  if (!body.name || !body.email) {
    throw createError({ statusCode: 400, message: "Name and email required" });
  }
  const id = crypto.randomUUID();
  await useStorage("db").setItem(`users:${id}`, { id, ...body, createdAt: Date.now() });
  setResponseStatus(event, 201);
  return { id, ...body };
});

// server/routes/health.get.ts
export default defineEventHandler(() => ({ status: "ok", timestamp: Date.now() }));

Middleware and Utils

// server/middleware/auth.ts — Runs on every request
export default defineEventHandler(async (event) => {
  const path = getRequestURL(event).pathname;
  if (path.startsWith("/api/public")) return;

  const token = getHeader(event, "authorization")?.replace("Bearer ", "");
  if (!token) throw createError({ statusCode: 401, message: "Unauthorized" });

  event.context.user = await verifyToken(token);
});

// server/utils/db.ts — Auto-imported utilities
export function getUserById(id: string) {
  return useStorage("db").getItem(`users:${id}`);
}

// server/middleware/cache.ts
export default defineEventHandler(async (event) => {
  if (getMethod(event) === "GET") {
    setResponseHeaders(event, { "Cache-Control": "s-maxage=60, stale-while-revalidate=300" });
  }
});

Storage & Tasks

// nitro.config.ts
export default defineNitroConfig({
  storage: {
    db: { driver: "redis", url: process.env.REDIS_URL },
    cache: { driver: "memory" },
    fs: { driver: "fs", base: "./data" },
  },
  scheduledTasks: {
    "*/5 * * * *": ["cleanup"],           // Every 5 minutes
    "0 9 * * *": ["daily-report"],
  },
});

// server/tasks/cleanup.ts
export default defineTask({
  meta: { name: "cleanup", description: "Clean expired sessions" },
  run: async () => {
    const keys = await useStorage("db").getKeys("sessions:");
    // ... cleanup logic
    return { result: `Cleaned ${deleted} sessions` };
  },
});

Installation

npx giget nitro my-app
cd my-app && npm install
npm run dev                                # Dev server on :3000
npm run build                              # Build for current preset
NITRO_PRESET=cloudflare-pages npm run build  # Build for Cloudflare

Best Practices

  1. File-based routing — server/routes/ maps to URLs; [param].ts for dynamic, .get.ts/.post.ts for methods
  2. Auto-imports — defineEventHandler, useStorage, createError auto-imported; no import statements needed
  3. Universal deployment — Same code deploys everywhere; change NITRO_PRESET to switch platform
  4. Storage abstraction — Use useStorage() for Redis, KV, FS, S3; swap drivers without changing code
  5. Server tasks — Define cron-like tasks in server/tasks/; scheduled via nitro.config.ts
  6. H3 under the hood — Nitro uses H3 for HTTP handling; ultralight, tree-shakeable, edge-compatible
  7. Cached routes — Use defineCachedEventHandler for automatic response caching; TTL-based invalidation
  8. WebSocket support — Use defineWebSocketHandler for real-time features; works across all platforms

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供 NitroJS 通用服务器引擎的专业支持,解决跨平台部署核心痛点
  • 涵盖文件路由、中间件、存储抽象、缓存、WebSocket 等完整后端开发能力
  • 面向开发者群体,具备明确的技术实用价值和广泛适用场景
Trigger Precision95/100

Highlights

  • description 精准描述 NitroJS 专家角色和核心能力
  • 触发词覆盖完整,包含 Nitro、Nuxt、Analog、SolidStart 等关键标识
  • 边界清晰,不易与其他 Skill 混淆
Structure and Standards90/100

Highlights

  • 文档结构清晰,分章节详述核心能力、安装和使用最佳实践
  • 提供丰富的 TypeScript 代码示例和配置文件说明
  • frontmatter 完整,包含许可证、兼容性、元数据等信息
Execution Reliability88/100

Highlights

  • 代码示例完整且参数使用正确,覆盖主要使用场景
  • 提供了清晰的安装命令和构建部署说明
  • 工具来源明确,基于 NitroJS 官方实现
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 117, 118

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.