Pages

Topics

Tools

↑↓navigate↵openescclose

All syntax guides

Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.

3,965 guides across 14 topics

Topics

Latest guides

3D illustration of a byte grid slab with encoding tiles flipping between hex and base64
Node.js

Node.js Buffer and TypedArray: Encodings and Binary Manipulation

A Buffer is a view over an ArrayBuffer, so byteLength is not string length and toString can silently corrupt split UTF-8. allocUnsafe and pooled buffers carry old data.

Node.jsBufferBinaryEncoding
3D illustration of a pipeline with source tank, transform chamber and destination tank with pressure gauges
Node.js

Node.js Streams: Readable, Writable, Transform, and pipeline

pipe() forwards data but not errors; pipeline() destroys the chain and rejects. Backpressure is the false return from write(), and _flush that never calls back hangs forever.

Node.jsStreamsBackpressurePerformance
3D illustration of file folder slabs with read and write arrows, a temporary swap tile and a watch eye
Node.js

Node.js fs/promises: Read, Write, Watch, and Atomic File Operations

writeFile truncates before writing, so a crash leaves half a file. The atomic pattern is temp file, fsync, rename; readFile loads everything, so large files need streams.

Node.jsfsFilesystemAsync
3D illustration of two gates labelled with import and require lanes beside a package json panel
Node.js

Node.js ESM vs CommonJS: import, require, and package.json exports

"type" decides how a .js file loads, and the exports field decides what a package exposes. Missing extensions, __dirname, and dual-package state are the usual failures.

Node.jsESMCommonJSModules
3D illustration of a circular conveyor with six phase stations and a priority chip jumping the queue
Node.js

Node.js Event Loop: Phases, Microtasks, and nextTick Order

Six phases, two queues that are not phases, and one rule: nextTick then microtasks drain between every callback. Why setTimeout and setImmediate swap order at top level.

Node.jsEvent LoopAsyncPerformance
3D illustration of a repository cube sweeping fragments into a bin while a rewritten history ribbon replaces the old
Git

Git clean, gc, and filter-repo: Removing Sensitive History

clean deletes untracked files with no undo, gc compacts objects, filter-repo rewrites every hash. Removing a secret means rotating it first and re-cloning afterwards.

GitSecurityHistoryMaintenance
3D illustration of a gear panel with shortcut chips wired into a keyring held by a locker
Git

Git config: Aliases, rerere, and Credential Helpers

Five config scopes decide one value at a time. Aliases are user-level shorthand, rerere records conflict resolutions, and credential helpers choose where your secret lives.

GitConfigurationAliasesCredentials
3D illustration of commit blocks rolling through check gates on a conveyor before a commit tray
Git

Git Hooks: pre-commit, commit-msg, and Husky Automation

Hooks live in .git/hooks, which a clone never receives, so core.hooksPath and Husky are how they travel. Exit codes abort the operation, and every hook is bypassable.

GitHooksHuskyAutomation
3D illustration of file cards passing a filter gate while ignored cards fall into a bin
Git

Git ignore: Patterns, Negation, and Untracking Cached Files

Patterns are relative and last match wins, but a negation cannot revive a file inside an excluded directory. Ignore rules never touch tracked files: rm --cached first.

GitGitignoreConfigurationCLI
3D illustration of a parent repository cube containing a nested repository cube beside a vendored copy
Git

Git Submodules vs Subtree: Cloning, Updating, and Removal

A submodule records a commit hash and needs an extra init step everywhere; a subtree copies files into your history. The comparison that decides which friction you want.

GitSubmodulesSubtreeDependency