nodejs-best-practices

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

1|Updated Jun 30, 2026
One-click install
npx skills add https://github.com/trutoman/Conjuros --skill nodejs-best-practices-trutoman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nodejs-best-practices
Source: https://github.com/trutoman/Conjuros/tree/main/.agents/skills/nodejs-best-practices
Command: npx skills add https://github.com/trutoman/Conjuros --skill nodejs-best-practices-trutoman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Node.js developers often default to familiar frameworks and patterns without considering whether they fit the project's deployment target, performance needs, or team context. This Skill provides decision-making principles for architecture, framework selection, error handling, validation, security, and testing so each project gets a stack chosen for its actual requirements. ## Core Features & Use Cases - Framework Selection Guidance: Decision trees and comparison tables for Hono, Fastify, Express, NestJS, and Next.js based on deployment target and performance needs. - Architecture & Async Principles: Layered structure (controller/service/repository), event loop awareness, and guidance on async/await, Promise.all, and worker threads for CPU-bound work. - 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 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 a Node.js framework for a new project?

Choose a Node.js framework based on deployment target and context: Hono for edge and serverless, Fastify for high-performance APIs, NestJS for enterprise structure, and Express for legacy or maximum ecosystem support. Consider cold start time, team experience, and existing code.

Fastify vs Express: which should I use for an API?

Fastify is 2-3x faster than Express and has excellent TypeScript support, making it better for performance-critical APIs. Express offers the largest middleware ecosystem and lowest learning curve, suiting legacy codebases and teams prioritizing stability.

Should I use ESM or CommonJS in Node.js?

Use ESM (import/export) for new projects since it is the modern standard with better tree-shaking and async module loading. Keep CommonJS for existing codebases or when specific npm packages require it.

When should I use worker threads in Node.js?

Use worker threads for CPU-bound work like cryptography, image processing, or complex calculations, since async patterns only help I/O-bound tasks. Offloading CPU work prevents blocking the event loop and keeps the server responsive.

What validation library should I use 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 cases, and Yup fits projects already using it with React forms.