Concept
Almost every Node API returns a promise, and async functions let you await them in sequence. Errors become rejections, which propagate to the nearest await inside a try block.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Promises and async/await doing its job.
import { readFile } from "node:fs/promises";
async function loadConfig(path) {
try {
const text = await readFile(path, "utf8");
return JSON.parse(text);
} catch (error) {
if (error.code === "ENOENT") return {};
throw error;
}
}
const config = await loadConfig("./config.json"); // top-level awaitCalling an async function without await or .catch(). A rejection becomes an unhandled rejection, which crashes modern Node processes by default.
Your roadmap puts these before Promises and async/await, unless you already know them.
Once a session shows you understand Promises and async/await, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on Promises and async/await.