Node.js Rules
Run JavaScript outside the browser. Manage packages, scripts, and server-side applications with Node.js runtime commands.
4 rules
Environment Variable Management
Manage Node.js environment variables properly — validate at startup, fail fast on missing required vars, use typed config objects, and never access process.env scattered through code.
Node.js Error Handling Patterns
Handle errors properly in Node.js — always catch promise rejections, use custom error classes, implement global error handlers, and never swallow errors silently.
Use ESM Modules Over CommonJS
All new Node.js projects must use ECMAScript modules (ESM) — set type: module in package.json, use import/export syntax, and handle the CJS interop correctly for legacy dependencies.
Node.js Security Essentials
Apply essential security practices for Node.js applications — validate all input, prevent injection attacks, secure HTTP headers, manage secrets properly, and audit dependencies.