Runtime and build tooling
Node.js
Node.js is a cross-platform JavaScript runtime built for event-driven programs and asynchronous input and output.
What is Node.js and what does it do?
Node.js is a cross-platform runtime that executes JavaScript outside the browser. It combines the V8 JavaScript engine with APIs for networking, files, processes, streams, and other operating-system work. This makes JavaScript usable for servers, command-line tools, automation, and development tooling.
Node.js is a runtime rather than a web framework. It supplies modules such as HTTP and streams, while routing, validation, application structure, and many service conventions come from application code or additional libraries.
The event loop is a coordinator
JavaScript callbacks run on the event loop. When supported asynchronous work begins, Node.js can let the operating system or its worker facilities handle that work and continue coordinating other events. Completion later schedules more JavaScript to process the result.
Request or event -> callback -> asynchronous operation -> completion -> next callback
This model is effective when a program spends much of its time waiting for networks, files, or other services. A long synchronous calculation has the opposite effect: it occupies the thread that should keep processing events. CPU-intensive work may need worker threads, separate processes, a queue, or a different service boundary.
Workload fit depends on waiting and computation
Node.js is commonly suited to:
- HTTP APIs that coordinate databases and other network services
- streaming and proxy workloads that process data incrementally
- command-line tools and build automation
- real-time connections with many independent events
Its event-driven model does not make every operation automatically non-blocking. Synchronous filesystem calls, expensive parsing, compression, image work, or unbounded loops can delay unrelated requests when placed on the event loop.
Streams, pressure, and process lifecycle
Streams let producers and consumers exchange data in chunks. Backpressure matters when the producer can generate data faster than the consumer can accept it; ignoring that signal can turn a streaming design into growing memory use.
A production process also needs timeouts, cancellation, error handling, resource limits, secure dependency management, and graceful shutdown. An HTTP listener is only the outer edge of a service. Reliability depends on how the process behaves when dependencies slow down, clients disconnect, or the host asks it to stop.