| name | nodejs |
| description | Guides AI agents to write idiomatic, correct Node.js JavaScript code. |
| metadata | {"tags":["nodejs","javascript","esm","async"]} |
Node.js Skill
Use this skill when writing any Node.js JavaScript code: modules, async logic, error handling, project structure, or environment configuration.
When to Use
- Writing or reviewing any Node.js source file
- Working with ESM modules, imports, and exports
- Handling async operations, Promises, or streams
- Managing environment variables and configuration
- Structuring a Node.js project
- Documenting API endpoints with Swagger/OpenAPI
Rules
- rules/esm.md — ESM module system: imports, exports, file extensions, dynamic imports.
- rules/async.md — Async/await, Promise patterns, error propagation, concurrency.
- rules/error-handling.md — Error types, propagation, process-level handlers, safe coding.
- rules/project-structure.md — Feature-oriented directory layout, config, environment variables, entry points.
- rules/swagger.md — JSDoc @swagger blocks with swagger-jsdoc: schemas, routes, parameters, tags.
Quick Reference
import { createUser } from './users.js';
import { readFile } from 'node:fs/promises';
async function loadConfig(path) {
const raw = await readFile(path, 'utf8');
return JSON.parse(raw);
}
const [users, products] = await Promise.all([getUsers(), getProducts()]);