nodejs
Installation
SKILL.md
Node.js Skill
Project Setup & Standards
- Use ES Modules (
"type": "module") for new projects. - Use TypeScript for all non-trivial projects; enable strict mode (
"strict": true). - Pin the Node.js version via
.nvmrcor.node-version. - Follow existing code style and conventions in the project — consistency over strict adherence.
- Apply KISS & DRY, but prioritize consistency with existing code.
- Use Airbnb or StandardJS style guide; enforce with ESLint + Prettier.
Async & Concurrency
- Prefer
async/awaitover raw Promise chains. - Never mix callbacks and Promises in the same module.
- Handle unhandled rejections:
process.on('unhandledRejection', ...). - Use
Promise.all()/Promise.allSettled()for parallel async operations. - Avoid blocking the event loop — offload CPU-heavy work to Worker Threads.