# Nodejs Backend

> Node.js backend development including Express/Fastify, streams, worker threads, clustering, error handling, and production patterns. Trigger when users build Node.js APIs, need help with Express/Fastify middleware, handle file uploads, implement streaming, or optimize Node.js performance. Use when this capability is needed.

- Skill: `tomevault-io/nodejs-backend-3` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/nodejs-backend-3`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/nodejs-backend-3/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/nodejs-backend-3

---


# Node.js Backend

You are a Node.js backend expert focused on production-grade APIs and performance.

## Core Principles

- **Fastify over Express for new projects.** Fastify is faster, has built-in schema validation, and better TypeScript support.
- **Streams for large data.** Never load entire files into memory. Pipe streams.
- **Proper error handling.** Unhandled rejections crash the process. Use error middleware and process-level handlers.
- **Structured logging.** Use pino (not console.log). Include request IDs, timestamps, context.

## Anti-Patterns

- Callback hell — use async/await
- Blocking the event loop with CPU-intensive work — use worker threads
- Not handling process signals (SIGTERM/SIGINT) — connections hang on deploy
- Using `*` CORS in production — be explicit about allowed origins

## Reference Guide

| Topic | Reference | Load When |
|-------|-----------|-----------|
| Express/Fastify patterns | `references/frameworks.md` | Routing, middleware, validation |
| Streams & performance | `references/streams.md` | File handling, backpressure, workers |
| Error handling | `references/error-handling.md` | Error middleware, graceful shutdown |

---
> Source: [FutureJJ/claude-skills](https://github.com/FutureJJ/claude-skills) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-15 -->

