Developers
nodejs
Notes tagged nodejs.
- tutorial17 min read
Testing with node:test
Node.js ships with a built-in test runner since version 18, and it's more capable than most developers realize. This tutorial covers everything you need to write a complete test suite using only node:test and node:assert — describe blocks, async tests, mocks, and running tests from the command line — without installing a single additional package.
- tutorial17 min read
Node.js streams intro
Streams are how Node.js processes large amounts of data without loading it all into memory first. If you've ever piped a file through a command in the terminal, you already know the core idea. This tutorial explains Node.js Readable, Writable, and Transform streams from scratch — when to use them, how to compose them with pipe, and how to handle errors correctly.
- tutorial17 min read
Node.js security basics
Most Node.js security incidents aren't sophisticated attacks — they're basic oversights: a secret committed to git, user input trusted without validation, a dependency with a known vulnerability. This tutorial covers the practical security baseline every Node.js application should have before it touches real users or real data.
- tutorial17 min read
Node.js error handling
Errors in Node.js fall into two categories: things that were expected to go wrong (a database query finds nothing, a file doesn't exist) and genuine bugs (typos, null references). This tutorial shows you how to handle the first kind gracefully, surface the second kind clearly, and structure your error handling so nothing silently disappears.
- tutorial17 min read
Node.js async patterns
Node.js does one thing at a time, but it never sits idle — that's the async model. This tutorial walks callbacks, Promises, and async/await from the ground up, shows when to run tasks in parallel vs. in sequence, and gives you patterns you can apply the next time an API call or database query is making your code hard to read.
- tutorial17 min read
MERN deployment checklist
Deployment is where many MERN projects stall — not because it's hard, but because the order of operations isn't obvious. This checklist walks through every step: MongoDB Atlas for the database, Render for Express, Vercel for React, and the environment variable and CORS configuration that makes them trust each other.
- tutorial17 min read
MERN API design
Most Express APIs start working before they start making sense. This tutorial gives you the patterns that make an Express API maintainable as it grows: resource-based routing, the routes/controllers split, correct HTTP status codes, input validation, and consistent error shapes that React can rely on.
- tutorial17 min read
MERN auth basics
Authentication in a MERN app crosses all four layers at once — that's why it trips people up. This tutorial connects the dots: bcrypt handles password storage, JWTs handle the signed token, and Express middleware handles route protection. By the end you'll have working auth code you understand well enough to adapt and debug.
- tutorial17 min read
MERN stack architecture
The MERN stack is four technologies that click together remarkably well — but only once you understand where each layer starts and stops. This tutorial maps the full architecture from MongoDB through Express and Node.js to React, so you always know exactly where your code lives, why it lives there, and what to check when something breaks.