All bites
The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.
8664 bites
Page 21
Diamond dependencies and nested node_modules
Npm hoists one version to the top and nests the conflicting version under the dependent package; both coexist on disk.
Circular dependencies in CommonJS modules
When A requires B which requires A, the cache returns A's partial exports; fields defined later are undefined at that moment.
SemVer and the caret vs tilde range operators
MAJOR.MINOR.PATCH signals breaking/feature/fix; caret allows minor and patch updates, tilde allows only patch; use tilde for tighter control.
Layered structure for a scalable Express API
Routes map URLs, controllers handle HTTP, services hold business logic, data layer talks to the DB; keep each layer ignorant of HTTP except controllers.
Choosing between CommonJS and ES Modules
ESM is the standard with static import/export and top-level await; set type to module; CJS uses require and module.exports and is synchronous.
Why package-lock.json must be committed
Lockfile pins exact versions of the whole dependency tree including transitive deps; guarantees identical installs across machines and CI.
Resolving core vs relative module specifiers
'fs' is a built-in core module loaded by name with top priority; './my-file.js' is a relative path resolved from the current file.
dependencies vs devDependencies in package.json
Dependencies ship and run in production; devDependencies are only for development; omitted with npm install --production.
Offloading CPU-bound work with Worker Threads
Synchronous CPU work freezes the loop and all requests; offload to a Worker, communicate via messages or SharedArrayBuffer, use a pool.
nextTick vs setImmediate vs setTimeout(fn, 0)
NextTick is a microtask that drains before the loop continues; setImmediate runs in check; setTimeout(0) in timers.
Order of the Node.js event loop phases
Timers, pending callbacks, poll, check, close phases in order; I/O completion runs in poll.
The WebSocket Protocol
WebSocket (RFC 6455) is a protocol providing full-duplex, persistent communication over a single TCP connection. It begins as an HTTP request that upgrades, then both client and server can send messages anytime, enabling real-time apps without HTTP's…
Federating reliability ownership to product teams
Build a self-service reliability platform (golden paths, paved roads), train teams and embed SLO/on-call practices, and govern with standards plus error budget…
Capacity planning for a distributed cache
Track hit ratio, memory and eviction rate, throughput/latency, and connections; correlate with growth to forecast when to add capacity before the hit ratio or evictions…
Capacity planning for distributed stateful systems
Account for replication and cross-region network, IOPS and disk throughput, connection limits, partition/shard balance, and N+1 region failover headroom; validate with load and chaos…
Designing a feature flagging service
Control plane (UI, store, targeting), SDKs that cache flags locally for zero-latency evaluation, streaming/CDN delivery for near-real-time updates, and stale-flag lifecycle tooling.
Managing a risky release with feature flags
Deploy code dark behind an off flag, enable for internal then small percentage, monitor metrics, ramp gradually, then remove the flag.
Automating actions on error budget burn
Use multi-window burn-rate alerts; on fast burn, auto-trigger actions like halting deploys, rolling back, or scaling, with escalating tiers.
Safeguards for automated remediation runbooks
Add rate limits and circuit breakers on restarts, escalate to humans after N attempts, log all actions, and check for cascading failure before acting.
Breaking tunnel vision during an incident
Call out the assumption, ask for disconfirming evidence, list parallel hypotheses, split responders to investigate them, and anchor on what changed and the data.