Node
Server-side JavaScript: the runtime, its standard library and the package ecosystem.
2026
- Use localStorage in Node scriptsPersist a small key-value counter across Node processes with localStorage and an explicit backing file, and know when to use another store.
- Replace Corepack after Node 25Install Corepack on Node 25, enable its pnpm shim, and use the packageManager pin to reproduce a frozen install in CI.
- Run TypeScript in Node without flagsRun a TypeScript script on Node 22.18 or later and use a separate compiler check to catch type errors.
- Route URLs with the global URLPatternMatch a Node HTTP pathname with URLPattern, capture its numeric ID, and dispatch the request using the match result.
- Compress data with zstd in node:zlibCompare gzip and Zstandard on one JSON fixture, verify the decoded bytes, and stream an export with node:zlib.
- Restrict file access with --permissionAllow a Node script to read its reports directory and see how a read outside that directory fails.
- require() ES modules from CommonJSUse require() to read a synchronous ESM namespace from CommonJS, and recognize when top-level await means you need dynamic import.
- Check stream backpressure before upgrading NodeRun the same stream probe on Node 20 and 22, then check where write starts returning false before switching production traffic.
- Run TypeScript enums on Node 22Run a TypeScript enum with Node 22’s transform flag, or express the same values with a plain object for a script that uses type stripping.
- Run erasable TypeScript directly in NodeRun a TypeScript utility directly on Node 22, use explicit source extensions and type imports, and keep type checking in a separate command.
- Query SQLite using node:sqliteCreate a file-backed SQLite database in Node, bind values with prepared statements, and read rows in a separate process without installing a driver.
- Connect with Node’s built-in WebSocket clientOpen a WebSocket from Node, send a text message after the connection opens, and close the client after the reply.
- Colour terminal output with util.styleTextUse Node’s util.styleText for CLI status colours and pass the destination stream so redirected diagnostics stay plain.
- Parse .env files in code with loadEnvFileprocess.loadEnvFile() loads a .env file into process.env with no dotenv dependency, and util.parseEnv() returns the values as an object instead.
2025
- Load .env files with --env-fileLoad local configuration with Node’s --env-file flag and see how multiple files and shell variables set the final value.
- Fake timers in node:testMove the clock by hand in node:test and prove a debounce waits until the full delay after the last call.
- Parse CLI flags with util.parseArgsUse util.parseArgs to read long flags, short flag clusters and filenames, then validate numeric values at the command line.
- Write and run tests with node:testWrite a test with node:test and node:assert, run it with node --test, read the failure diff, and see which file names the runner finds.
- Restart a Node server with --watchRun node --watch to restart a server when its entry file or any module it imports changes, and see how it handles a crash.
- Shut down a Node HTTP server cleanlyHandle SIGTERM in Node, give in-flight HTTP responses time to finish and close connections that pass the deadline.