Generate production-ready Node.js Cursor rules for Project Rules (.mdc), AGENTS.md, or legacy .cursorrules. This template encodes stack-specific conventions for projects using Node.js. JavaScript runtime built on V8 with event-driven, non-blocking I/O.
The template focuses Cursor AI on concrete Node.js practices instead of generic coding advice. Required sections are always included; optional sections can be enabled when they match your project.
Required guidance
- Project Structure
- Async Patterns
- Streams & Buffers
- Security
Default style
- Indentation: 2 spaces
- Quotes: single
- Semicolons: enabled
- Naming: camelCase
Example Node.js Rules
The generator turns these sections into Project Rules with frontmatter, AGENTS.md, or a single .cursorrules file depending on the output format you choose.
Project Structure
- Use ES modules ("type": "module" in package.json).
- Use 2 spaces for indentation.
- Use camelCase for variables and functions.
- Organize code by feature, not by file type.
- Use src/ for source code, tests/ for tests.
- Use barrel exports (index.js) for clean API surfaces.
Async Patterns
- Use async/await over callbacks and raw promises.
- Use try/catch for error handling in async functions.
- Use Promise.all() for parallel independent operations.
- Use Promise.allSettled() when partial failures are acceptable.
- Avoid blocking the event loop — don't use sync file/network operations.
- Use AbortController for cancellable async operations.
Streams & Buffers
- Use streams for processing large data sets (pipeline pattern).
- Use stream.pipeline() or pipeline() from stream/promises.
- Use Transform streams for data transformation.
- Handle backpressure with proper stream consumption.
- Use Buffer for binary data — prefer Buffer.from() over new Buffer().
- Use Readable.from() for converting iterables to streams.
What does the Node.js Cursor rules template include?
It includes 4 rule sections covering project structure, async patterns, streams & buffers and other Node.js development conventions.
Can I generate Node.js Project Rules and AGENTS.md from the same template?
Yes. The generator can export the same stack-specific guidance as modern Project Rules (.mdc), AGENTS.md, or a legacy .cursorrules file.
Should I combine Node.js with other Cursor rules templates?
Yes. You can combine Node.js with related templates such as TypeScript, Tailwind CSS, Docker, or backend frameworks when your project uses multiple technologies.