Knowledgebase

Understanding Node.js Print

  • backenddevelopment, backend, performance, guide, howto, solution, zillionkinghost, hosting
  • 0

JavaScript outside the browser.

WHAT IT IS

A runtime executing JavaScript on the server.

WHY IT IS USED

One language across the stack An enormous package ecosystem Strong performance for input and output heavy work

WHAT THE CONCURRENCY MODEL IS

A single-threaded event loop, handling many connections by never waiting.

WHAT THAT MEANS

It excels at many concurrent connections doing little computation.

WHAT IT IS POOR AT

Heavy computation, which blocks everything.

WHAT BLOCKING LOOKS LIKE

Long loops Synchronous file operations Large synchronous parsing or encryption

WHAT TO DO ABOUT COMPUTATION

Move it to worker threads, a separate service, or a background queue.

WHAT MODULE SYSTEMS EXIST

The older format, and the standard module format.

WHAT TO PREFER

The standard format, for new work.

WHAT TO BE CAREFUL WITH

Mixing them, which produces confusing errors.

WHAT TO PIN

The runtime version, matching development and production.

WHY

Behaviour differs between versions, and mismatches produce failures only in production.

WHAT TO LEARN FIRST

Asynchronous patterns, modules, and the standard library.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot