🌍 NodeJS · subject
NodeJS Introduction to NodeJS Syllabus
The Introduction to NodeJS syllabus for NodeJS in full: 2 chapters and 6 topics, every one listed below, plus 50 Introduction to NodeJS flashcards with answers.
Introduction to NodeJS syllabus: all 2 chapters
Expand any chapter to see its topics and sub-topics.
-
What is NodeJS?
3 topics- Definition and Purpose
- History and Evolution
- Key Features
-
Setting Up NodeJS
3 topics- Installation
- Node Version Manager (nvm)
- Verifying Installation
NodeJS Introduction to NodeJS flashcards — 50 questions with answers
What is Node.js?
Node.js is an open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a web browser, built on Chrome's V8 JavaScript engine.
What is the primary purpose of Node.js?
To run JavaScript on the server side, enabling developers to build scalable network applications (web servers, APIs, real-time apps) using a single language (JavaScript) for both client and server.
Which JavaScript engine powers Node.js?
Google's V8 engine (the same engine used in the Chrome browser), which compiles JavaScript directly to native machine code.
What programming language do you write Node.js applications in?
JavaScript (and also languages that compile to JavaScript, such as TypeScript).
Is Node.js a programming language, a framework, or a runtime?
It is a runtime environment, not a programming language or a framework. It provides an environment in which JavaScript code can be executed outside the browser.
What I/O model does Node.js use, and why?
An event-driven, non-blocking (asynchronous) I/O model, which makes it lightweight and efficient for data-intensive, real-time applications that run across distributed devices.
Who created Node.js and in what year?
Ryan Dahl created Node.js in 2009.
Why was Node.js originally created (the problem it solved)?
To overcome the limitations of blocking, thread-per-connection web servers (like Apache) by providing a non-blocking, event-driven server capable of handling many concurrent connections efficiently.
On which operating system was Node.js first demonstrated, and at what event?
It was first demonstrated on Linux (and macOS) by Ryan Dahl at the European JSConf in November 2009.
What company sponsored the early development of Node.js?
Joyent sponsored and supported the early development of Node.js.
What is npm and when was it introduced?
npm (Node Package Manager) is the default package manager for Node.js, introduced in 2010, used to install, share, and manage third-party JavaScript packages.
What was the io.js fork and how was it resolved?
io.js was a 2014 community fork of Node.js created due to governance concerns; it was merged back with Node.js in 2015 under the newly formed Node.js Foundation, unifying the codebases.
What organization currently governs Node.js development?
The OpenJS Foundation, formed in 2019 by merging the Node.js Foundation and the JS Foundation.
What are the two Node.js release lines, and how do they differ?
LTS (Long-Term Support) releases, which have even major version numbers and are recommended for production due to stability and extended support; and Current releases, which have the latest features but shorter support.
How do even and odd major version numbers relate to Node.js release lines?
Even-numbered major versions (e.g., 18, 20, 22) become LTS releases; odd-numbered versions are Current-only and never promoted to LTS.
Name three key features of Node.js.
(1) Asynchronous and event-driven (non-blocking I/O); (2) Single-threaded with an event loop for high concurrency; (3) Very fast execution due to the V8 engine. (Others: large npm ecosystem, cross-platform, no buffering.)
Is Node.js single-threaded or multi-threaded?
Node.js runs JavaScript on a single main thread using an event loop, but it offloads certain operations (like file/network I/O) to a background thread pool (via libuv), so it behaves concurrently without creating a thread per request.
What is the event loop in Node.js?
A mechanism that continuously checks for and dispatches events/callbacks, allowing Node.js to perform non-blocking operations on a single thread by delegating I/O and processing callbacks when operations complete.
What library provides Node.js's asynchronous, non-blocking I/O and event loop?
libuv, a C library that provides the event loop, thread pool, and cross-platform asynchronous I/O.
Why is Node.js considered highly scalable for I/O-bound applications?
Because its non-blocking, event-driven model lets a single thread handle thousands of concurrent connections without the overhead of one thread per connection, making it efficient for I/O-bound workloads.
Show the other 30 Introduction to NodeJS flashcards
For what type of workload is Node.js NOT well suited?
CPU-intensive (CPU-bound) tasks, because heavy computation blocks the single main thread and stalls the event loop, delaying all other requests.
What module system did Node.js traditionally use, and what modern standard does it now support?
Traditionally CommonJS (using require() and module.exports); it now also supports ECMAScript Modules (ESM) using import and export.
In CommonJS (Node.js), what is used to import and export modules?
require() is used to import a module, and module.exports (or exports) is used to export values from a module.
What does 'cross-platform' mean in the context of Node.js?
Node.js runs on multiple operating systems, including Windows, macOS, and Linux, allowing the same code to run across different platforms.
What does it mean that Node.js applications 'never buffer' data?
Node.js outputs data in chunks (streams) rather than buffering the entire response, so applications can process and emit data piece by piece, reducing memory use and latency.
Where can you download the official Node.js installer?
From the official website, nodejs.org, which provides installers and binaries for Windows, macOS, and Linux.
Which Node.js version is recommended for most users installing Node.js?
The LTS (Long-Term Support) version, because it is stable and supported for production use.
What tool is automatically installed alongside Node.js?
npm (Node Package Manager) is bundled with and installed automatically alongside Node.js.
How can you install Node.js on macOS using a package manager?
Using Homebrew with the command $\texttt{brew install node}$ (or install nvm first, then use nvm to install Node).
What is a common way to install Node.js on Linux distributions like Ubuntu?
Using the system package manager (e.g., $\texttt{sudo apt install nodejs npm}$), the NodeSource repository, or nvm for version management.
What is nvm?
nvm (Node Version Manager) is a command-line tool that lets you install, manage, and switch between multiple versions of Node.js on the same machine.
Why would a developer use nvm instead of a single system-wide Node install?
To easily install and switch between multiple Node.js versions per project, test code against different versions, and avoid permission issues and conflicts from a global install.
Which command installs a specific version of Node.js using nvm?
$\texttt{nvm install <version>}$, for example $\texttt{nvm install 20}$ or $\texttt{nvm install 20.11.0}$.
Which command installs the latest LTS version of Node.js with nvm?
$\texttt{nvm install --lts}$.
How do you switch to (activate) an installed Node.js version using nvm?
$\texttt{nvm use <version>}$, for example $\texttt{nvm use 20}$.
Which nvm command lists all Node.js versions installed on your machine?
$\texttt{nvm ls}$ (or $\texttt{nvm list}$).
Which nvm command lists all Node.js versions available to install?
$\texttt{nvm ls-remote}$ (on Windows nvm-windows: $\texttt{nvm list available}$).
How do you set a default Node.js version for new terminal sessions with nvm?
$\texttt{nvm alias default <version>}$, for example $\texttt{nvm alias default 20}$.
What is the difference between nvm on macOS/Linux and nvm-windows?
The original nvm (nvm-sh) is a shell script for macOS/Linux; Windows uses a separate project, nvm-windows, which has similar but not identical commands and is installed differently.
What file can define the Node.js version a project should use with nvm?
An $\texttt{.nvmrc}$ file placed in the project root; running $\texttt{nvm use}$ then reads it and switches to the specified version.
Which command verifies the installed Node.js version?
$\texttt{node -v}$ (or $\texttt{node --version}$), which prints the installed Node.js version, e.g. v20.11.0.
Which command verifies the installed npm version?
$\texttt{npm -v}$ (or $\texttt{npm --version}$).
What does the 'v' prefix in Node's version output (e.g., v20.11.0) indicate?
It simply stands for 'version'; the number that follows (20.11.0) is the semantic version of Node.js that is installed.
How can you verify Node.js works by running a quick command from the terminal?
Run $\texttt{node -e "console.log('Hello, Node!')"}$, or start the REPL with $\texttt{node}$ and type a JavaScript expression to see it evaluated.
What is the Node.js REPL and how do you start it?
The REPL (Read-Eval-Print Loop) is an interactive shell for running JavaScript line by line; you start it by typing $\texttt{node}$ (with no arguments) in the terminal.
What does the versioning scheme MAJOR.MINOR.PATCH mean in Node.js (semantic versioning)?
MAJOR changes introduce breaking changes, MINOR adds backward-compatible features, and PATCH provides backward-compatible bug fixes. So in $20.11.0$: MAJOR $=20$, MINOR $=11$, PATCH $=0$.
Compare Node.js and JavaScript in the browser: what is the key difference?
Browser JavaScript runs in a sandbox with access to the DOM and browser APIs but not the file system; Node.js runs on the server with access to the file system, network, OS, and modules, but has no DOM.
How does Node.js differ from traditional server technologies like PHP/Apache in handling requests?
Traditional servers often use a blocking, thread-per-request model, whereas Node.js uses a single-threaded, non-blocking, event-driven model that handles many concurrent connections with one thread.
Which command upgrades npm itself to the latest version?
$\texttt{npm install -g npm@latest}$ (installs the newest npm globally).
Name two categories of applications Node.js is especially well suited for.
Real-time applications (e.g., chat apps, live collaboration) and I/O-bound applications such as REST APIs, streaming services, and microservices. (Also single-page app backends and command-line tools.)
NodeJS Introduction to NodeJS FAQ
What is in the NodeJS Introduction to NodeJS syllabus?
NodeJS Introduction to NodeJS is split into 2 chapters: What is NodeJS? and Setting Up NodeJS. Together they contain 6 topics.
How many chapters are in NodeJS Introduction to NodeJS?
2 chapters, containing 6 topics. The largest chapter is What is NodeJS?, with 3 topics.
Are there flashcards for NodeJS Introduction to NodeJS?
Yes — a 50-card Introduction to NodeJS deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.