# Nodejs

> Use when: write or review Node.js backends with correct async, error handling, and resource limits.

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

---


Goal: reliable Node.js services that handle async and failure well.

Use for:
- HTTP services, workers, or CLI tools on Node
- reviewing async flow, error handling, and config
- fixing unhandled rejections and blocking code

Workflow:
1. Use async/await; never mix with unhandled callbacks.
2. Handle promise rejections and process-level error events.
3. Keep the event loop unblocked; offload CPU-heavy work.
4. Load config and secrets from the environment, validated.
5. Stream large payloads instead of buffering them whole.
6. Verify with tests and a linter; check for leaks under load.

Patterns:
- async/await with try/catch at boundaries
- AbortController for cancellation and timeouts
- streams for large data
- graceful shutdown on SIGTERM

Rules:
- never leave a promise rejection unhandled
- do not block the event loop with sync CPU work
- validate environment config at startup
- set timeouts on outbound calls

