Skip to content
Learn Netverks

Lesson

Step 6/36 17% through track

node-runtime

The Node.js runtime

Last reviewed May 28, 2026 Content v20260528
Track mode
nodejs_server
Means
Node sandbox
Reading
~1 min
Level
beginner

This lesson

This lesson teaches The Node.js runtime: the syntax, APIs, and habits you need before advancing in Node.js.

Teams ship The Node.js runtime on every Node.js codebase—skipping it leaves gaps in debugging and code reviews.

You will apply The Node.js runtime in contexts like: REST/GraphQL APIs, BFF layers, CLIs, webhooks, and real-time services (with WebSockets).

Run JavaScript on the Node runner when configured—never mix arbitrary shell commands in lessons.

When you can explain the previous lesson's ideas without copying starter code.

When you run node main.mjs, Node loads V8, initializes libuv for async I/O, and executes your module graph. The process object exposes version info, environment variables, and exit codes.

Key process properties

  • process.version — Node semver (e.g. v20.x)
  • process.env — environment variables (strings)
  • process.cwd() — current working directory
  • process.argv — CLI arguments after node
  • process.exit(code) — terminate (0 success, non-zero error)

LTS vs Current

Use LTS (Long Term Support) releases in production—they receive security fixes longer. Odd-numbered releases are "Current" and shorter-lived. Check nodejs.org for the active LTS line.

Important interview questions and answers

  1. Q: What is libuv?
    A: The C library Node uses for the event loop, thread pool, and async file/network operations on multiple OSes.
  2. Q: How do you read an env var safely?
    A: process.env.PORT ?? '3000' with validation at startup—never assume vars exist in production.

Self-check

  1. What does exit code 0 mean?
  2. Where do CLI flags passed to your script appear?

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • process.argv use?
  • global vs globalThis?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump