Skip to content

Posts

JavaScript Basics: Extract Text With Regular Expressions

A log line might contain a ticket number, a status, and a short message. A regular expression can describe the text we want to extract without splitting every line at fixed …

Read more →

October 16, 2026

JavaScript Basics: UTF-8, Hex, and Base64 with Buffers

A Node.js Buffer holds bytes. Use it when text needs an encoding or when data isn’t text at all. These examples were tested on Linux with Node.js v24.19.0 and use only built-in …

Read more →

October 16, 2026

JavaScript Basics: Working with Paths in Node.js

Use Node’s built-in node:path module to assemble paths and extract filenames. These examples run on Linux with Node.js v24.19.0. No packages are needed. Set up a scratch directory …

Read more →

October 16, 2026

JavaScript Basics: Validate Numbers from Text

A text field containing 12 still holds text. Before doing arithmetic, decide which inputs are acceptable, convert them, and check the result. This tutorial builds a finite-number …

Read more →

October 16, 2026

JavaScript Basics: Clean, Search, and Split Strings

Text often needs a little preparation before a program can use it. This tutorial covers trimming whitespace, finding text, splitting fields, and replacing repeated text. It also …

Read more →

October 16, 2026

JavaScript Basics: Validate Environment Variables in Node.js

Environment variables let you configure a program when you launch it. A setting that looks like a number or boolean still arrives as text, so checking it early prevents confusing …

Read more →

October 14, 2026

JavaScript Basics: Test Small Functions With Node's Built-in Runner

A function can look correct and still mishandle an empty input or a boundary value. Automated tests turn those expectations into checks you can repeat after every change. This …

Read more →

October 14, 2026

JavaScript Basics: Split Reusable Code Into ES Modules

When two scripts need the same helper function, copying it creates two places to maintain. An ES module lets one file export useful code and another import it. We’ll put a greeting …

Read more →

October 14, 2026

JavaScript Basics: Build and Edit URLs With URLSearchParams

A search term such as tea & cake needs special handling inside a URL. Joining strings by hand can accidentally turn part of the term into another query parameter. JavaScript’s URL …

Read more →

October 14, 2026

JavaScript Basics: Add Command-Line Options with parseArgs

A command-line option lets someone change a script’s behavior without editing its source. This tutorial builds a small greeting command with a name, repetition count, uppercase …

Read more →

October 14, 2026