How nnxi/nodejs-api-docgen works
nodejs-api-docgen is a command-line tool that turns Express route comments into shareable HTML API documentation. Its workflow reads a selected application or router file, parses JavaScript into an AST, extracts route definitions and their documentation tags (including mounted subrouters), then generates and opens an HTML document. The README also documents strict tag filtering and the generated document’s use as a team-facing API reference. The core workflow is evidenced in the CLI and sampled modules; the output’s later serving is documented in the README.
Main entry points: index.js CLI entry · extractor.js Route extractor · generator.js HTML generator · parser.js AST parser
Components 9
CLI workflow
- CLI entry
index.js
Route analysis
- AST parser
src/parser.js - Route extractor
src/extractor.js
Documentation output
- HTML generator
src/generator.js - Generated API docs
api-docs.html
Other components
- Developer
- Express source
- Team reader
- Local browser
Connections 10
- Developer → CLI entry: runs
README.md - CLI entry → Express source: reads
index.js - CLI entry → AST parser: parses with
index.js - CLI entry → Route extractor: extracts via
index.js - Route extractor → AST parser: parses subrouters
src/extractor.js - Route extractor → Route extractor: recurses into
src/extractor.js - CLI entry → HTML generator: generates with
index.js - HTML generator → Generated API docs: writes
src/generator.js - HTML generator → Local browser: opens file in
src/generator.js - Team reader → Generated API docs: views
README.md