Node.js Fundamentals
Node.js is a runtime that executes JavaScript outside a web browser. It combines the V8 engine with operating-system APIs so programs can read files, open network connections, run command-line tools, and serve many concurrent requests.
itWeb development | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Node.js Fundamentals
Node.js is JavaScript with a job outside the browser: it runs as an operating-system process and brings files, network sockets, timers, streams, and process controls to the party. The language is still JavaScript. The surroundings are not. A browser document does not arrive with the luggage, which is often the first clue that the runtime has changed rooms.
The important arrangement is one main JavaScript thread taking short turns around work that is waiting elsewhere. The event loop chooses the next ready callback after the current one returns. Network activity can continue while the thread is free. That is why a Node.js server can wait on many connections without appointing a personal thread to each one, a management style that would become expensive quite quickly.
Here is the surprise: async is not a tiny forklift for calculations. It changes how a function reports its eventual result through a promise. A long calculation remains on the main thread unless the application moves it. Worker threads are the deliberate in-process option for parallel JavaScript. Child processes, containers, and external workers make different bargains about isolation and durable work.
A program begins with an entry file, loads modules, and stays around while it still owns work such as a server, socket, or timer. Node.js supports ECMAScript modules and CommonJS, which are both useful right up to the point where one file is interpreted as the other. State the module format in package.json or use the explicit extensions; mystery is rarely a productive dependency.
Data arrives through callbacks, promises, events, and streams. Streams move bytes in pieces, so a slow consumer must be allowed to slow the producer. That arrangement is called backpressure. Ignore it and memory becomes the unpaid intern carrying an ever-growing pile of chunks until it resigns.
Errors also need a named owner. A thrown exception, rejected promise, or emitted error travels by a different route. A process that reaches unknown state should end normal operation; a supervisor provides the fresh replacement. During shutdown, stop new work, allow in-flight work a deadline, close resources, and then leave without trying to write an epic sequel from a damaged process.
Read the Intro for the architecture and choices. Use Slides when the moving parts need a compact map. Keep the Cheatsheet nearby for module markers, streams, process states, and diagnosis. Then use the practice reference and exercise to make the request-response path and its test observable. The next pieces of Node.js will have somewhere sensible to attach themselves.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://nodejs.org/learn/getting-started/introduction-to-nodejs
Supports
- Node.js definition
- V8 embedding
- cross-platform runtime
- asynchronous I/O
- server use
- https://nodejs.org/en/learn/asynchronous-work/event-loop-timers-and-nexttick
Supports
- Event-loop phases
- callbacks
- timers
- immediates
- poll behavior
- https://nodejs.org/en/learn/asynchronous-work/dont-block-the-event-loop
Supports
- Main event loop
- libuv worker pool
- blocking effects
- bounded per-client work
- https://nodejs.org/api/packages.html
Supports
- Package scope
- type field
- mjs and cjs markers
- exports and main entry points
- https://nodejs.org/api/modules.html
Supports
- CommonJS module behavior
- require
- module exports
- module caching
- https://nodejs.org/api/process.html
Supports
- Process arguments
- environment
- standard streams
- exit behavior
- signals
- uncaught exceptions and rejections
- https://nodejs.org/api/stream.html
Supports
- Readable
- writable
- duplex
- transform streams
- backpressure
- pipeline
- error handling
- https://nodejs.org/api/buffer.html
Supports
- Buffers as byte sequences
- encodings
- binary data behavior
- https://nodejs.org/api/errors.html
Supports
- Synchronous errors
- callback errors
- promise rejections
- EventEmitter error behavior
- https://nodejs.org/api/http.html
Supports
- HTTP server request and response objects as stream interfaces
- headers and response completion
- https://nodejs.org/api/worker_threads.html
Supports
- Parallel JavaScript execution
- worker threads for CPU-intensive work
- transfer and sharing mechanisms
- https://nodejs.org/api/test.html
Supports
- Built-in test runner
- suites
- assertions
- mocks
- coverage and command-line execution
- https://nodejs.org/api/diagnostics_channel.html
Supports
- Named diagnostic channels and subscriber model
- https://nodejs.org/en/about/previous-releases
Supports
- Current
- LTS
- Maintenance and EOL states
- production recommendation
- release dates
- https://nodejs.org/en/about/eol
Supports
- End-of-life security and maintenance consequences
- https://nodejs.org/en/blog/announcements/making-nodejs-downloads-reliable
Supports
- Project beginning in 2009
- 2014 io.js fork
- 2015 merge
- https://openjsf.org/blog/maintainers-should-consider-following-node-js-release-schedule
Supports
- 2015 Node.js Foundation announcement
- Node.js version 4 cadence and LTS history
- https://nodejs.org/download/release/v4.0.0/
Supports
- Node.js version 4 release dated 2015 Sep 8
- https://nodejs.org/en/blog/release/v6.0.0
Supports
- Node.js version 6 release dated 2016 Apr 26 and V8 language support changes
- https://nodejs.org/en/blog/release/v8.0.0
Supports
- Node.js version 8 release dated 2017 May 30 and async hooks introduction
- https://nodejs.org/en/blog/release/v10.0.0
Supports
- Node.js version 10 release dated 2018 Apr 24 and promises-based file APIs
- https://nodejs.org/en/blog/release/v12.11.0
Supports
- Worker threads marked stable in 2019 Sep
- https://nodejs.org/en/blog/release/v14.0.0
Supports
- Node.js version 14 release dated 2020 Apr and ECMAScript module warning removal
- https://github.com/sindresorhus/awesome
Supports
- Discovery of the Awesome Node.js list
- https://github.com/sindresorhus/awesome-nodejs
Supports
- Discovery of Fastify
- Express
- Pino
- Vitest
- Prisma and BullMQ ecosystem projects
- https://fastify.dev/docs/latest/
Supports
- Fastify routing
- validation
- plugins
- logging and module examples
- https://expressjs.com/en/starter/installing.html
Supports
- Express installation
- application setup
- routing and middleware study path
- https://getpino.io/#/docs/api
Supports
- Pino structured logging API and stream-oriented destinations
- https://vitest.dev/guide/
Supports
- Vitest setup
- watch mode
- mocking
- coverage and TypeScript tooling
- https://www.prisma.io/docs/orm
Supports
- Prisma Client
- schema
- migrations and Node.js database access
- https://docs.bullmq.io/
Supports
- Redis-backed queues
- workers
- retries and distributed background work
- https://docs.deno.com/runtime/
Supports
- Deno runtime
- permissions
- built-in tooling and Node compatibility
- https://bun.com/docs/runtime
Supports
- Bun runtime
- JavaScriptCore engine and integrated tooling
- https://docs.npmjs.com/about-npm
Supports
- npm registry
- command-line client and package ecosystem
- https://pnpm.io/motivation
Supports
- pnpm content-addressable storage and npm compatibility
- https://yarnpkg.com/getting-started
Supports
- Yarn package management and workspace workflow
- https://pm2.keymetrics.io/docs/usage/quick-start/
Supports
- PM2 process supervision
- restart
- logs and clustering
- https://docs.aws.amazon.com/lambda/latest/dg/lambda-nodejs.html
Supports
- AWS Lambda Node.js runtimes and handler execution
- https://deepnote.com/blog/profiling-nodejs-blocked-event-loop-in-production
Supports
- Production incident with a blocked Node.js event loop
- Liveness-probe failures
- On-demand CPU profiling triggered during termination
