... in the previous chapters...

Node.js features that replace popular npm packages

Node.js has quietly absorbed the jobs that used to need dependencies: a test runner, a file watcher, a .env loader, native TypeScript, fetch, terminal colors, deep clone, even SQLite. Here's what you can drop on Node.js 26 — every example verified on a real node:26 Docker image.

Modern JavaScript features you can use in Node.js 26

A batch of genuinely useful JavaScript additions is now unflagged in Node.js 26: Set operations (union, intersection, difference), lazy iterator helpers, RegExp.escape, Promise.try, Array.fromAsync, and Float16Array. Here's each one with real, verified output.

Temporal: the modern way to handle dates in Node.js

JavaScript's broken Date object finally has a replacement. Temporal — Stage 4 in ES2026 and enabled by default in Node.js 26 — brings immutable date/time types, real time-zone support, and sane arithmetic. Here's how to use it, with examples and the polyfill for older environments.

The HTTP QUERY method: GET semantics with a request body

The new HTTP QUERY method (RFC 10008, 2026) gives you the safe, idempotent, cacheable semantics of GET with the request body of POST — ideal for large or structured read operations. Here's its status, browser and server support, and a form + fetch + Node example you can actually test.

How to set up Tailwind CSS v4

Tailwind CSS v4 is CSS-first: no tailwind.config.js, no @tailwind directives, and automatic content detection. Here's how to set it up with Vite, PostCSS, or the CLI, customize your theme with @theme, and migrate from v3.

How to save a web page as PNG or PDF with Puppeteer?

Turn any web page into a PDF or a full-page PNG screenshot with Puppeteer and headless Chrome — natively, in just a few lines, with none of the Xvfb, DPI, or screenshot-stitching workarounds the old Nightmare approach required.

How to Use Quill (with react-quill-new) and Distinguish <ul> vs <ol> Lists Using getSemanticHTML()

Quill internally renders both bullet and numbered lists as <ol> elements, which can break list semantics when saving content. Using getSemanticHTML() with react-quill-new ensures your exported HTML correctly distinguishes between <ul> and <ol>.

How to format output of international phone number with JavaScript

JavaScript offers lots of NPM packages, and every day it keep counting! I'm here to help you find those that work.

How to create a simple Node app to generate PDF from HTML

Node offers lots of options for data processing and conversion. One of the common scenarios is converting websites to PDF or PNG.

TypeScript-friendly useSize from @react-hook/resize-observer.

So you went to https://www.npmjs.com/package/@react-hook/resize-observer and copied useSize, but it has a bunch of typescript errors, and it pisses you off (I know it does).
Here's a version that is TypeScript-friendly... And not just that, it's a complete file you can put in your project and import from your components:
import useResizeObserver from "@react-hook/resize-observer" import { useLayoutEffect, useState } from "react" const useSize = (target:any) => { const [size, setSize] = useState<DOMRectReadOnly>() useLayoutEffect(() =>...

Argument of type 'FormData' is not assignable to parameter of type 'string | string[][] | Record | URLSearchParams | undefined'.

It's very disappointing when you find this issue was there for 5 years and it was Closed without being resolved.
Here's the full error as shown by TypeScript:
const fd = new FormData(form); const values = new URLSearchParams(fd).toString(); Argument of type 'FormData' is not assignable to parameter of type 'string | string[][] | Record<string, string> | URLSearchParams | undefined'. Type 'FormData' is missing the following properties from type 'URLSearchParams': size, sort...

Group in a group with TailwindCSS.

Some time ago, there was a common problem of having multiple nested group classes. Imagine having a main menu dropdown group, where top level elements are groups, and sub-level elements are groups as well. You might be tempted to use something like this:
<ul class="relative"> <li class="group"> Top level item <ul class="hidden group-hover:block"> <li class="group"> Sub level items will be here <ul class="hidden group-hover:block"> <li>Sub-sub level item 1</li> <li>Sub-sub level item 2</li> <li>Sub-sub level item 3</li> </ul> </li> </ul> </li> </ul>
While...

About Code with Node.js

This is a personal blog and reference point of a Node.js developer.

I write and explain how different Node and JavaScript aspects work, as well as research popular and cool packages, and of course fail time to time.