A serialization library uses util.types.isDate() and isRegExp() to correctly detect these types during serialization, impossible to do reliably with typeof alone.
Likely follow-ups
How does util.types.isNativeError() differ from checking instanceof Error?
What's the relationship between util.types and Object.prototype.toString.call()?
Design Patterns in JavaScriptDebugging & Diagnostics
require() is synchronous, part of CommonJS; import is part of the ES Module standard, resolved as part of module loading, requiring either a .mjs extension or "type": "module" in package.json -- core modules support both, but a project must be consistent about which system its files use.
// CommonJS
const fs = require('node:fs');
// ES Modules
import fs from 'node:fs';
Real-world example
A team migrating to ES Modules sets "type": "module" in package.json and converts every require() to import, checking remaining CommonJS-only dependencies still load via Node's interop.
Likely follow-ups
What's the interop rule for a CommonJS file trying to import an ES Module?
Why does an ESM file need dynamic import() to conditionally load a CommonJS module?
Modules (CommonJS/ESM)CLI Tools & Scripting with Node.js
readline reads input from a readable stream (commonly process.stdin) line by line -- the standard way to build interactive command-line prompts, asking the user a question and waiting for their response without manually buffering stdin.
A database migration CLI uses readline to prompt 'This will delete data, continue? (y/n)' before a destructive operation, giving the user a chance to cancel.
Likely follow-ups
How does readline/promises simplify usage with async/await compared to the callback-based version?
How would you build a multi-step interactive CLI wizard using repeated readline.question() calls?
perf_hooks provides high-resolution timing via performance.now() (unaffected by system clock adjustments, unlike Date.now()) and PerformanceObserver for capturing marks and measures -- useful for precisely benchmarking operations without clock-drift imprecision.
An API wraps a latency-sensitive query with performance.now() timestamps for its metrics system, using perf_hooks since Date.now()'s lower resolution would be less reliable for sub-millisecond differences.
Likely follow-ups
Why is performance.now() more reliable for timing than Date.now()?
How does PerformanceObserver compare to simply subtracting two performance.now() timestamps?
EventEmitter enables the publish/subscribe pattern -- objects extending it emit named events via .emit(), subscribed via .on() or .once(). Core APIs built on streams and servers follow lowercase, camelCase event names like 'data', 'error', 'close', a convention userland libraries typically follow too.
A job-processing library built on EventEmitter emits 'started', 'progress', and 'completed' events, following familiar conventions that make the API immediately intuitive to Node.js developers.
Likely follow-ups
What happens if an EventEmitter emits an 'error' event with no listener attached?
How does EventEmitter's default max-listener limit (10) work, and when would you raise it?
Events & EventEmitterDesign Patterns in JavaScript