Skip to content
tezvyn:

Node.js & Express

Node.js, Express, Fastify, NestJS, Bun, Deno

38 bites

Test yourself: Top 30 easy Node.js & Express concepts questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Easy concepts in Node.js & Express

easy2 min read

V8: The Engine Powering Chrome and Node.js

V8 is the engine that runs your JavaScript, translating it into machine code. It powers both the Chrome browser and the Node.js server-side runtime. The common footgun is confusing the engine (V8) with the runtime environment that provides it with APIs.

easy2 min read

Node.js Events and the EventEmitter

Node.js handles concurrency with an event-driven model, not threads. "Emitters" fire named events that "listeners" react to, enabling non-blocking I/O for things like file reads and web requests.

easy2 min read

CommonJS: Node.js's Original Module System

CommonJS treats each file as a private box of code. You share tools using exports and import them with require. It's the original module system for Node.js, used to organize code into reusable pieces.

package.json: The Blueprint for Your Node.js Project
easy2 min read

package.json: The Blueprint for Your Node.js Project

The package.json file is the blueprint for a Node.js project, listing its dependencies and runnable scripts. It's essential for installing libraries (npm install) and running tasks (npm test).

Dependencies vs. DevDependencies: What's the Difference?
easy2 min read

Dependencies vs. DevDependencies: What's the Difference?

Dependencies are packages your app needs to run in production (like a web framework). DevDependencies are for your development workflow (like a test runner). The footgun is mixing them up, which bloats your production build with unnecessary code.

npm Scripts: Your Project's Command-Line Shortcuts
easy2 min read

npm Scripts: Your Project's Command-Line Shortcuts

Think of npm scripts as aliases for your project's common command-line tasks, stored in package.json. Use them to run build tools, start servers, or execute tests. The main footgun is forgetting npm run for custom scripts like lint or build.

easy2 min read

Node.js Callbacks: Functions That Run Later

A callback is a function you pass to run later when an event fires or work finishes, keeping Node.js free to handle other work. HTTP servers use them to respond to connections without blocking.

JavaScript Promises: Handling Future Values
easy2 min read

JavaScript Promises: Handling Future Values

A Promise is an IOU for a future value from an async operation. Instead of blocking your code, you get an object that will eventually contain the result or an error. They're essential for API calls or file reads.

easy2 min read

Creating a Basic HTTP Server in Node.js

A Node.js HTTP server is a listening post that waits for requests on a port and runs your code to reply. It's the foundation for any web service, from simple APIs to full apps. The footgun: forgetting response.end() leaves the client hanging indefinitely.

easy2 min read

Node.js File I/O: Synchronous vs. Asynchronous

Synchronous file I/O blocks your app, like waiting at a counter for your order. Asynchronous I/O gets a buzzer, letting your app work on other tasks. Use async for servers and sync for simple, one-off scripts. The footgun is using sync I/O in a server.

easy2 min read

__dirname and __filename: Path Anchors in Node.js

__dirname and __filename act as GPS for your Node.js files, giving you the absolute path to the current file and its directory. This is essential for reliably loading adjacent files, like templates or configs. The main gotcha: they don't exist in ES Modules.

easy2 min read

Node.js os Module: Reading Your System's Vital Signs

The Node.js os module is your app's dashboard for the host machine's vitals. Use it to check CPU cores, free memory, or platform type to adapt your code. The footgun is assuming consistency; system details can vary wildly between environments.

Creating Your First Express Server
easy2 min read

Creating Your First Express Server

Think of an Express app as three steps: require the library, create an instance, and listen on a port. This is the foundation for any Express-based API or web server.

Express.js: Basic Request Routing
easy2 min read

Express.js: Basic Request Routing

Express routing connects a request's path and HTTP method (like GET /) to a specific handler function. This is the core of any Express app, used to define API endpoints or handle form submissions. A common mistake is using the wrong method for a request.

Express Request and Response Objects (req, res)
easy2 min read

Express Request and Response Objects (req, res)

Think of Express's req and res as an incoming letter and your reply. req contains the client's request details, like headers and data, while res is your toolkit for sending a response. They are the core of every route handler.

Express Middleware: Intercepting Requests Before Your Route Handler
easy2 min read

Express Middleware: Intercepting Requests Before Your Route Handler

Express middleware is like a bouncer for your routes, running code before your main handler. Use it for logging, authentication, or parsing request bodies. The biggest footgun is forgetting to call next() or send a response, which leaves requests hanging.

easy2 min read

REST: The Architectural Style of the Web

REST is a set of design rules, not a strict protocol, for building massive distributed systems like the web. These constraints enable independent component deployment, scalable interactions, and a layered architecture that supports caching and security.

HTTP Status Codes: The Server's Signal
easy2 min read

HTTP Status Codes: The Server's Signal

HTTP status codes are the server's signal for a request's outcome: success, client error, or server error. You see them when fetching data (200 OK), hitting a bad link (404), or when a server fails (500). Footgun: Don't just check for 'not 200'.

easy2 min read

ODM: Your Database as JavaScript Objects

ODM translates JavaScript objects to database records and back, letting you work with plain objects instead of raw queries. It removes boilerplate in Node.js apps but hides the real queries underneath.

easy2 min read

Node.js Built-in SQLite Driver

Node.js bundles a SQLite driver in node:sqlite. Open a file with new DatabaseSync(path), then run SQL with exec() or prepared statements. Use it for local tools and caches. DatabaseSync is synchronous, so running it on a web server main thread blocks requests.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles