~/talk

Node.js Loader Hooks for Fun and Profit

Talkat Node+JS Interactive 2019 · 2019-12-11..12-12· [nodejs, javascript]
slides:none on file

Shows the experimental Node.js loader hook API (Node 12, ES modules only, run with --experimental-modules and --experimental-loader) and three concrete builds that actually run: on-the-fly TypeScript transpile via typescript.transpileModule (reads .ts, writes .mjs, returns the JS URL), remote HTTP module fetch to /tmp then load (downloads a URL synchronously and resolves it), and proxy-based dependency injection exposing handlers (wraps exports with proxies and dynamicInstantiate to modify behavior); demos work but note experimental, synchronous, and not production-ready.

AI-written summary · about

  1. 0:00Start
  2. 0:54Detecting loaded modules
  3. 1:15Check require.cache
  4. 2:27Monkeypatch Module._load
  5. 3:47Loader hooks
  6. 4:44loader.mjs
  7. 7:18TypeScript loader
  8. 11:29Remote loader
  9. 12:01index.mjs
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.