nodejs-best-practices

Guides Node.js architecture decisions covering framework selection, async patterns, security, and testing.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/Ishaq74/atomic --skill nodejs-best-practices-ishaq74
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nodejs-best-practices
Source: https://github.com/Ishaq74/atomic/tree/main/.github/skills/nodejs-best-practices
Command: npx skills add https://github.com/Ishaq74/atomic --skill nodejs-best-practices-ishaq74

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Node.js developers often default to familiar frameworks and patterns without evaluating whether they fit the project's deployment target, performance needs, or team context. This Skill provides decision-making frameworks for architecture, async patterns, validation, security, and testing so choices are grounded in actual requirements. ## Core Features & Use Cases - Framework Selection Guidance: Decision trees and comparison tables for Hono, Fastify, Express, and NestJS based on deployment target, cold start needs, and ecosystem maturity. - Architecture & Async Principles: Layered structure (controller/service/repository), event loop awareness, and guidance on when to use Promise.all, allSettled, or worker threads. - Security & Validation Checklists: Input validation boundaries, library selection (Zod, Valibot, ArkType), and a security checklist covering hashing, JWT, rate limiting, and secrets management. - Use Case: When starting a new serverless API, use this Skill to evaluate whether Hono fits the edge deployment target, plan the layered structure, and define the validation and error-handling strategy before writing code. ## Quick Start Ask the AI to help you choose a Node.js framework and architecture for your project, describing your deployment target and performance requirements.

Frequently Asked Questions about nodejs-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between Hono, Fastify, and Express for a Node.js API?

Choose based on deployment target and context: Hono for edge and serverless with fast cold starts, Fastify for high-performance APIs, and Express for legacy codebases or maximum ecosystem support. Consider team experience and existing code before deciding.

What validation library should I use in Node.js with TypeScript?

Zod is the default choice for TypeScript-first projects with type inference. Valibot offers a smaller tree-shakeable bundle, ArkType targets performance-critical paths, and Yup fits projects already using React form integrations.

Should I use ESM or CommonJS for a new Node.js project?

Use ESM (import/export) for new projects since it is the modern standard with better tree-shaking and async module loading. CommonJS remains appropriate for existing codebases or packages with compatibility constraints.

When does async/await not help Node.js performance?

Async patterns help I/O-bound work like database queries and HTTP requests, but not CPU-bound tasks such as crypto operations, image processing, or complex calculations. Offload CPU-intensive work to worker threads to avoid blocking the event loop.

What are the limitations of a principles-based best practices guide?

It teaches decision-making rather than providing copy-paste code, so output requires environment-specific validation and testing. You should ask for clarification when requirements, deployment targets, or success criteria are unclear.