# 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.

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

---


# 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 |

