Node.js API Pitfalls; Can You Spot Them?
summary
Node core has concrete surprises: process.nextTick calls immediately while setImmediate runs on the next loop, cluster’s worker.kill first disconnects the worker so a HUP handler may never see the signal, cluster.suicide flags an orderly exit (the opposite of the word), url.parse keeps a host property that makes hostname and port ignored, and path.format ignores name/ext when base is present. Streams preserve backward compat behavior so pause/pipe have no hard guarantees, forcing tradeoffs between stability and cleaner APIs.
AI-written summary · about
chapters (12)
- 0:00Introduction to Node.js
- 1:20Next Tick vs. Immediate
- 2:02Event Loop Phases
- 3:33Understanding Node Cluster
- 5:19Worker Kill Pitfalls
- 7:02Cluster Suicide Property
- 8:30Improving API Naming
- 10:03URL Parsing Idiosyncrasies
- 11:32Host vs. Hostname Properties
- 13:14Path Module Pitfalls
- 16:56Stream Backwards Compatibility
- 18:20Future of Node.js APIs
