markdown-toc
API and CLI for generating a markdown TOC (table of contents)
markdown-toc is a JavaScript API and CLI for generating tables of contents from Markdown files. It uses Remarkable to parse Markdown headings and turn them into linked TOC entries. Developers can run it from the command line, inject a TOC directly into a file, or use it programmatically from Node.js. The tool can also output JSON so applications can render their own TOC templates. It includes options for heading depth, bullet style, filtering, slug generation, indentation, and first-heading behavior. It is especially useful for maintaining README files, documentation pages, and generated docs where headings change over time.