Node.js Foundations
Node.js turns JavaScript into a server-side runtime. That shift changes where code runs, how I/O behaves, and how you structure applications.
What Node is
Node is not a framework. It is a runtime built on the V8 engine plus APIs for files, networking, timers, and process control.
Use cases
- Backend APIs and microservices.
- CLI tools and automation scripts.
- Build pipelines, dev servers, and project scaffolding.
- Real-time applications that need sockets and event-driven I/O.
Why it matters
- Use one language across frontend tools and backend services.
- Build command-line tools and automation scripts.
- Work with a huge package ecosystem through npm.
- Choose simpler deployment models for small teams and fast iteration.
Runtime model
JavaScript source
-> Node runtime
-> V8 executes code
-> libuv handles async I/O
What is specific to Node
processfor environment, arguments, exit codes, and runtime metadata.- Built-in modules such as
node:fs,node:path,node:http, andnode:crypto. - CommonJS support alongside ECMAScript modules in modern projects.
- File system access, stream handling, and server sockets that browser JavaScript does not expose in the same way.
Practice
- Explain the difference between a browser and a runtime.
- List three Node APIs you cannot get from plain browser JavaScript.
- Write one note about when Node is a good fit and when it is not.
- Choose one real project idea and decide whether Node would be a good fit.