Step 3 / Select topic Node.js Medium

What this bank covers

  • What setTimeout returns in Node
  • Extra arguments passed to a timer callback
  • unref'd timers and process lifetime
  • setTimeout returns a Timeout object in Node
  • unref removes a timer's hold on the event loop
  • Extra setTimeout arguments are forwarded to the callback
  • UTF-8 byte length vs character count
  • Base64 encoding of a 4-byte buffer
  • Lenient hex decoding
  • latin1 encoding is not UTF-8
  • byteLength depends on the encoding
  • Partial writes never split a UTF-8 character
  • Decoding a truncated UTF-8 sequence
  • Buffers compare by bytes, not by source encoding
  • Buffer.from(arrayBuffer) creates a view, not a copy
  • The 'ascii' decoder masks the high bit
  • Resolving a relative URL against a base
  • get versus getAll on URLSearchParams
  • URL origin excludes credentials
  • Root-relative references ignore the base directory
  • URLSearchParams uses form encoding for spaces
  • Default ports are dropped from a URL
  • The URL parser removes dot segments from the path
  • AggregateError from Promise.any
  • uncaughtException keeps the loop alive
  • Custom error subclasses and err.name
  • unhandledRejection timing
  • process.env stores only strings
  • Assigning null to an environment variable
  • delete removes a key from process.env
  • The first element of process.argv
  • The exit event handler is synchronous only
  • process.version vs process.versions.node
  • process.hrtime.bigint returns a BigInt
  • process.env is live, a spread is a snapshot
  • Assigning undefined to an environment variable
  • process.env coerces values to strings
  • for await over an array of promises
  • Promise.allSettled result statuses
  • Async function body before the first await
  • Async functions reject instead of throwing
  • Promise.race settles with the first result
  • setImmediate vs setTimeout inside an I/O callback
  • What setTimeout returns in Node.js
  • setTimeout return value and extra arguments
  • prependListener puts a listener at the front
  • emit iterates over a snapshot of the listeners
  • Unhandled 'error' events are thrown
  • eventNames() only lists events that still have listeners
  • once fires for a single emit and receives spread arguments
  • Return value of emitter.emit
  • once() fires at most one time
  • listeners() vs rawListeners() for once handlers
  • The newListener event fires before registration
  • Readable.from defaults to object mode
  • Transform callbacks push one chunk each
  • write() return value and backpressure
  • pipeline rejects and cleans up
  • 'end' requires the data to be consumed
  • setEncoding decodes chunks to strings
  • 'finish' fires before 'close'
  • highWaterMark is advisory, flowing starts as null
  • The flush hook appends a trailing chunk
  • writableEnded versus writableFinished
  • readFileSync without an encoding
  • Return value of recursive mkdirSync
  • Error shape for a missing file
  • The 'wx' exclusive write flag
  • fs.writeSync with a position
  • fs.truncateSync length argument
  • renameSync over an existing destination
  • readdirSync entries
  • What fs/promises writeFile resolves to
  • appendFileSync on a missing file
  • path.join normalizes but keeps the trailing separator
  • URL.host drops the default port for the scheme
  • path.posix.join normalizes and clamps at root
  • exports vs module.exports
  • Module bodies run once
  • Cached exports are shared state
  • Invalidating require.cache
  • Circular requires see partial exports
  • The node: prefix for builtins
  • The CommonJS module wrapper
  • require.resolve does not load
  • Failed loads are not cached
  • Directory resolution and package.json main
  • Node AssertionError fields
  • events.errorMonitor does not consume 'error'
  • stream/promises pipeline error propagation
  • Errors from the WHATWG URL parser in Node
  • Callback-style fs errors bypass try/catch
  • util.promisify keeps only the first success value
  • events.once resolves with an array of emitted arguments
  • AsyncLocalStorage propagates across async boundaries
  • Array.prototype.forEach does not await async callbacks
  • nextTick drains between immediate callbacks