Node.js flash cards: Apprentice level

21 Node.js terms at the Apprentice level, as flash cards.

Updated

Terms in this deck

Built-In Module
A module that comes with Node, such as node:fs/promises or node:path, imported with node: in front and nothing to install.
dotenv
Loads a .env file into process.env.
ENOENT
The error code Node gives when there's no file or folder at a path, short for "error: no entry".
ES Modules in Node
The modern import/export module system in Node.
Express
The most popular Node web framework.
express.json()
Parses JSON request bodies into req.body.
fs Module
The built-in module for files.
http Module
Node's built-in module for web servers: http.createServer makes a server from a function that answers every request.
Middleware in Express
Functions that run before handlers and call next().
NODE_ENV
The environment variable that says where Node code is running, such as development, test or production.
nodemon and --watch
Restarts the app automatically when files change.
npx
Runs a package command without installing it globally.
path Module
Builds file paths that work on every OS.
process.argv
The array of words that started a Node program: node's path, the script's path, then every word typed after them.
process.env
Holds environment variables.
Query Parameters in Express
The query string's name=value pairs, which Express reads into req.query, always as text, or undefined when one wasn't sent.
req and res
The request and response objects in a handler.
res.json()
Sends data as a JSON response in Express: it turns the data into JSON text, sets the Content-Type header and ends the response.
Route in Express
Connects a method and path to a handler.
Route Parameters in Express
URL parts captured into req.params.
Static Files in Express
Serves files from a folder.

Read them in the glossary