Node JS

JavaScript runtime built on Chrome's V8 engine Use when this capability is needed.

tomevault-io Updated

File contents

Node.js Skill

Best Practices

  1. Async/Await: Use async/await over Callbacks and raw Promises.
  2. Error Handling: Always handle Promise rejections (.catch() or try/catch). Unhandled rejections crash the process.
  3. Streams: Use Streams/Pipelines for large file processing to save memory.
  4. Security: Use helmet for headers. Validate all inputs.

Common Pitfalls

  • Blocking the Event Loop: CPU-intensive tasks (e.g., image resizing) on the main thread. Use Worker Threads or queues.
  • Sync APIs: Using fs.readFileSync in HTTP handlers. Never do this.

References


Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/sami--widgets--nodejs commit 55340d302b

Frequently asked questions

npx skillmds@latest add tomevault-io/node-js