$ the-wire · showcase
cjs-module-lexer drops Node.js 18, doc-kit opens its Markdown pipeline
By RepoJournal · Filed · About Node.js · Composed from the cited sources · methodology
cjs-module-lexer cut per-parse JavaScript CPU time on small modules by roughly 9x while declaring Node.js 18 the floor, and doc-kit made its Markdown pipeline and LLM output configurable instead of hardcoded.
perf(lexer): reduce per-parse allocations (#131) nodejs/cjs-module-lexer
Small modules used to allocate six 1024-element stacks per parse despite bounded nesting; the lexer now resets their cursors instead, dropping JavaScript CPU time on `exports.name = 1; module.exports.second = 2;` from 3.76us to 0.43us. The Wasm wrapper moves less on the same input, 0.401us to 0.370us, measured on Node v22.23.3 with V8 12.4.254.21-node.57.
build(deps)!: update tooling for Node.js 18 nodejs/cjs-module-lexer
Babel CLI 8 excludes Node.js 18, and its older line carries an affected watcher dependency this build does not use, so the tooling moved forward and the supported floor moved with it. Node.js versions below 18 are no longer supported, and local and Wasm container builds must share the same CommonJS transform settings because the container does not mount Babel configuration files.
feat: add a `markdown` option for remark, rehype, and recma plugins nodejs/doc-kit
Generators previously built their unified processors in code, so anything like math or diagrams meant changing doc-kit itself; a generator now declares its pipeline as `markdown`, with `'...'` marking where remark, rehype, and recma plugins go. That also covers configuring plugins the generators already use, such as Shiki.
feat(llms-txt): write each page's Markdown and llms-full.txt nodejs/doc-kit
Two opt-in options land on the `llms-txt` generator: `writeMarkdown` emits every page at `{path}.md`, which is where `llms.txt` links by default, so those links resolve without a separate copy step, and `writeFull` emits `llms-full.txt` with each page preceded by its URL in the format VitePress' llms plugin produces.
feat(html): client-side navigation with the Navigation API nodejs/doc-kit
Clicking a link no longer loads a new page from scratch: the browser fetches the next page's HTML, swaps the `<body>`, and keeps scripts, stylesheets, fonts, and in-memory data loaded. That matters because with `max-age=0, must-revalidate` the browser revalidates every asset per page load, and on doc-kit.nodejs.org each click also hits a 308 redirect from `.html` to the clean URL.
fix(parser): report nesting and template errors consistently nodejs/cjs-module-lexer
In the long tail, the Wasm parser returned success on unexpected closing braces and unterminated nesting because errors were discarded or never recorded, while the JavaScript parser called an undefined helper and threw a ReferenceError on unterminated templates.